public class BrowserInformationControl extends AbstractInformationControl implements IInformationControlExtension2, IDelayedInputChangeProvider
Browser widget.
This IInformationControlExtension2 expects setInput(Object) to be
called with an argument of type BrowserInformationControlInput.
Moved into this package from org.eclipse.jface.internal.text.revisions.
This class may be instantiated; it is not intended to be subclassed.
Current problems:
| Constructor and Description |
|---|
BrowserInformationControl(Shell parent,
String symbolicFontName,
boolean resizable)
Creates a browser information control with the given shell as parent.
|
BrowserInformationControl(Shell parent,
String symbolicFontName,
String statusFieldText)
Creates a browser information control with the given shell as parent.
|
BrowserInformationControl(Shell parent,
String symbolicFontName,
ToolBarManager toolBarManager)
Creates a browser information control with the given shell as parent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInputChangeListener(IInputChangedListener inputChangeListener)
Adds a listener for input changes to this input change provider.
|
void |
addLocationListener(LocationListener listener)
Adds the listener to the collection of listeners who will be
notified when the current location has changed or is about to change.
|
Point |
computeSizeConstraints(int widthInChars,
int heightInChars)
Computes the size constraints based on the
dialog font. |
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.
|
void |
dispose()
Disposes this information control.
|
BrowserInformationControlInput |
getInput() |
boolean |
hasContents()
Returns whether this information control has contents to be displayed.
|
boolean |
hasDelayedInputChangeListener()
Tells whether a delayed input change listener is registered.
|
static boolean |
isAvailable(Composite parent)
Tells whether the SWT Browser widget and hence this information
control is available.
|
void |
notifyDelayedInputChange(Object newInput)
Notifies listeners of a delayed input change.
|
void |
removeInputChangeListener(IInputChangedListener inputChangeListener)
Removes the given input change listener from this input change provider.
|
void |
setBackgroundColor(Color background)
Sets the background color of this information control.
|
void |
setDelayedInputChangeListener(IInputChangedListener inputChangeListener)
Sets or clears the delayed input change listener.
|
void |
setForegroundColor(Color foreground)
Sets the foreground color of this information control.
|
void |
setInformation(String content)
Deprecated.
use
setInput(Object) |
void |
setInput(Object input)
Sets the input to be presented in this information control.
|
void |
setSize(int width,
int height)
Sets the size of this information control.
|
void |
setVisible(boolean visible)
Controls the visibility of this information control.
|
String |
toString() |
addDisposeListener, addFocusListener, containsControl, create, getBounds, getInformationPresenterControlCreator, getShell, getSizeConstraints, getToolBarManager, isFocusControl, isResizable, isVisible, removeDisposeListener, removeFocusListener, restoresLocation, restoresSize, setFocus, setLocation, setSizeConstraints, setStatusTextpublic BrowserInformationControl(Shell parent, String symbolicFontName, boolean resizable)
parent - the parent shellsymbolicFontName - the symbolic name of the font used for size computationsresizable - true if the control should be resizablepublic BrowserInformationControl(Shell parent, String symbolicFontName, String statusFieldText)
parent - the parent shellsymbolicFontName - the symbolic name of the font used for size computationsstatusFieldText - the text to be used in the optional status field
or null if the status field should be hiddenpublic BrowserInformationControl(Shell parent, String symbolicFontName, ToolBarManager toolBarManager)
parent - the parent shellsymbolicFontName - the symbolic name of the font used for size computationstoolBarManager - the manager or null if toolbar is not desiredpublic static boolean isAvailable(Composite parent)
parent - the parent component used for checking or null if nonetrue if this control is availableprotected 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 AbstractInformationControlparent - the container of the contentpublic void setInformation(String content)
setInput(Object)
The default implementation does nothing. Subclasses must either override this method
or implement IInformationControlExtension2.
setInformation in interface IInformationControlsetInformation in class AbstractInformationControlcontent - the information to be presentedIInformationControl.setInformation(java.lang.String)public void setInput(Object input)
String and
BrowserInformationControlInput.setInput in interface IInformationControlExtension2input - the object to be used as input for this controlpublic void setVisible(boolean visible)
IInformationControlNote: The information control must not grab focus when made visible.
setVisible in interface IInformationControlsetVisible in class AbstractInformationControlvisible - true if the control should be visiblepublic void setSize(int width, int height)
IInformationControlsetSize in interface IInformationControlsetSize in class AbstractInformationControlwidth - the width of the controlheight - the height of the controlpublic void dispose()
IInformationControldispose in interface IInformationControldispose in class AbstractInformationControlpublic Point computeSizeHint()
IInformationControlcomputeSizeHint in interface IInformationControlcomputeSizeHint in class AbstractInformationControlpublic Rectangle computeTrim()
AbstractInformationControlcomputeTrim in interface IInformationControlExtension3computeTrim in class AbstractInformationControlx and y denote
the upper left corner of the trimming relative to this control's
location i.e. this will most likely be negative values.
width and height represent the
border sizes (the sum of the horizontal and vertical trimmings,
respectively).IInformationControlExtension3.computeTrim()public void addLocationListener(LocationListener listener)
listener - the location listenerpublic void setForegroundColor(Color foreground)
IInformationControlsetForegroundColor in interface IInformationControlsetForegroundColor in class AbstractInformationControlforeground - the foreground color of this information controlpublic void setBackgroundColor(Color background)
IInformationControlsetBackgroundColor in interface IInformationControlsetBackgroundColor in class AbstractInformationControlbackground - the background color of this information controlpublic boolean hasContents()
IInformationControlExtensionhasContents in interface IInformationControlExtensiontrue if there is contents to be displayed.public void addInputChangeListener(IInputChangedListener inputChangeListener)
inputChangeListener - the listener to addpublic void removeInputChangeListener(IInputChangedListener inputChangeListener)
inputChangeListener - the listener to removepublic void setDelayedInputChangeListener(IInputChangedListener inputChangeListener)
IDelayedInputChangeProvidersetDelayedInputChangeListener in interface IDelayedInputChangeProviderinputChangeListener - the new delayed input change listener, or
null if nonepublic boolean hasDelayedInputChangeListener()
true iff a delayed input change
listener is currently registeredpublic void notifyDelayedInputChange(Object newInput)
newInput - the new input, or null to request cancellationpublic BrowserInformationControlInput getInput()
nullpublic Point computeSizeConstraints(int widthInChars, int heightInChars)
AbstractInformationControldialog font. Subclasses can
override or extend.computeSizeConstraints in interface IInformationControlExtension5computeSizeConstraints in class AbstractInformationControlwidthInChars - the width constraint in number of charactersheightInChars - the height constraint in number of charactersnull
to use the subject control's font to calculate the sizeIInformationControlExtension5.computeSizeConstraints(int, int)