Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.jface.text.source.projection
Class SourceViewerInformationControl  view SourceViewerInformationControl download SourceViewerInformationControl.java

java.lang.Object
  extended byorg.eclipse.jface.text.source.projection.SourceViewerInformationControl
All Implemented Interfaces:
org.eclipse.swt.events.DisposeListener, java.util.EventListener, org.eclipse.jface.text.IInformationControl, org.eclipse.jface.text.IInformationControlExtension, org.eclipse.swt.internal.SWTEventListener

class SourceViewerInformationControl
extends java.lang.Object
implements org.eclipse.jface.text.IInformationControl, org.eclipse.jface.text.IInformationControlExtension, org.eclipse.swt.events.DisposeListener

Source viewer based implementation of org.eclipse.jface.text.IInformationControl. Displays information in a source viewer.

Since:
3.0

Field Summary
private static int BORDER
          Border thickness in pixels.
private  int fMaxHeight
          The maximal widget height.
private  int fMaxWidth
          The maximal widget width.
private  org.eclipse.swt.widgets.Label fSeparator
          The separator for the optional status field.
private  org.eclipse.swt.widgets.Shell fShell
          The control's shell
private  org.eclipse.swt.widgets.Label fStatusField
          The optional status field.
private  org.eclipse.swt.graphics.Font fStatusTextFont
          The font of the optional status text label.
private  org.eclipse.swt.custom.StyledText fText
          The control's text widget
private  org.eclipse.jface.text.source.SourceViewer fViewer
          The control's source viewer
 
Constructor Summary
SourceViewerInformationControl(org.eclipse.swt.widgets.Shell parent, int shellStyle, int style, java.lang.String symbolicFontName, java.lang.String statusFieldText)
          Creates a source viewer information control with the given shell as parent.
SourceViewerInformationControl(org.eclipse.swt.widgets.Shell parent, java.lang.String symbolicFontName)
          Creates a source viewer information control with the given shell as parent and the given font.
 
Method Summary
 void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
          Adds the given listener to the list of dispose listeners.
 void addFocusListener(org.eclipse.swt.events.FocusListener listener)
          Adds the given listener to the list of focus listeners.
 org.eclipse.swt.graphics.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 hasContents()
          Returns whether this information control has contents to be displayed.
 boolean isFocusControl()
          Returns whether this information control has the focus.
 void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
          Removes the given listeners from the list of dispose listeners.
 void removeFocusListener(org.eclipse.swt.events.FocusListener listener)
          Removes the given listeners from the list of focus listeners.
 void setBackgroundColor(org.eclipse.swt.graphics.Color background)
          Sets the background color of this information control.
 void setFocus()
          Sets the keyboard focus to this information control.
 void setForegroundColor(org.eclipse.swt.graphics.Color foreground)
          Sets the foreground color of this information control.
 void setInformation(java.lang.String content)
          Sets the information to be presented by this information control.
 void setInput(java.lang.Object input)
           
 void setLocation(org.eclipse.swt.graphics.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.
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent event)
          Sent when the widget is disposed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BORDER

private static final int BORDER
Border thickness in pixels.

See Also:
Constant Field Values

fShell

private org.eclipse.swt.widgets.Shell fShell
The control's shell


fText

private org.eclipse.swt.custom.StyledText fText
The control's text widget


fViewer

private org.eclipse.jface.text.source.SourceViewer fViewer
The control's source viewer


fStatusField

private org.eclipse.swt.widgets.Label fStatusField
The optional status field.


fSeparator

private org.eclipse.swt.widgets.Label fSeparator
The separator for the optional status field.


fStatusTextFont

private org.eclipse.swt.graphics.Font fStatusTextFont
The font of the optional status text label.


fMaxWidth

private int fMaxWidth
The maximal widget width.


fMaxHeight

private int fMaxHeight
The maximal widget height.

Constructor Detail

SourceViewerInformationControl

public SourceViewerInformationControl(org.eclipse.swt.widgets.Shell parent,
                                      java.lang.String symbolicFontName)
Creates a source viewer information control with the given shell as parent and the given font.


SourceViewerInformationControl

public SourceViewerInformationControl(org.eclipse.swt.widgets.Shell parent,
                                      int shellStyle,
                                      int style,
                                      java.lang.String symbolicFontName,
                                      java.lang.String statusFieldText)
Creates a source viewer information control with the given shell as parent. The given shell styles are applied to the created shell. The given styles are applied to the created styled text widget. The text widget will be initialized with the given font. The status field will contain the given text or be hidden.

Method Detail

setInput

public void setInput(java.lang.Object input)

setInformation

public void setInformation(java.lang.String content)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the information to be presented by this information control.

Replaced by IInformationControlExtension2.setInput(Object)>IInformationControlExtension2.setInput(Object) 55 .

Specified by:
setInformation in interface org.eclipse.jface.text.IInformationControl

setVisible

public void setVisible(boolean visible)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Controls the visibility of this information control.

Specified by:
setVisible in interface org.eclipse.jface.text.IInformationControl

widgetDisposed

public void widgetDisposed(org.eclipse.swt.events.DisposeEvent event)
Description copied from interface: org.eclipse.swt.events.DisposeListener
Sent when the widget is disposed.

Specified by:
widgetDisposed in interface org.eclipse.swt.events.DisposeListener

dispose

public final void dispose()
Description copied from interface: org.eclipse.jface.text.IInformationControl
Disposes this information control.

Specified by:
dispose in interface org.eclipse.jface.text.IInformationControl

setSize

public void setSize(int width,
                    int height)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the size of this information control.

Specified by:
setSize in interface org.eclipse.jface.text.IInformationControl

setLocation

public void setLocation(org.eclipse.swt.graphics.Point location)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the location of this information control.

Specified by:
setLocation in interface org.eclipse.jface.text.IInformationControl

setSizeConstraints

public void setSizeConstraints(int maxWidth,
                               int maxHeight)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the information control's size constraints. A constraint value of -1 indicates no constraint. This method must be called before computeSizeHint is called.

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

Specified by:
setSizeConstraints in interface org.eclipse.jface.text.IInformationControl

computeSizeHint

public org.eclipse.swt.graphics.Point computeSizeHint()
Description copied from interface: org.eclipse.jface.text.IInformationControl
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.

Specified by:
computeSizeHint in interface org.eclipse.jface.text.IInformationControl

addDisposeListener

public void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Adds the given listener to the list of dispose listeners. If the listener is already registered it is not registered again.

Specified by:
addDisposeListener in interface org.eclipse.jface.text.IInformationControl

removeDisposeListener

public void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Removes the given listeners from the list of dispose listeners. If the listener is not registered this call has no effect.

Specified by:
removeDisposeListener in interface org.eclipse.jface.text.IInformationControl

setForegroundColor

public void setForegroundColor(org.eclipse.swt.graphics.Color foreground)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the foreground color of this information control.

Specified by:
setForegroundColor in interface org.eclipse.jface.text.IInformationControl

setBackgroundColor

public void setBackgroundColor(org.eclipse.swt.graphics.Color background)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the background color of this information control.

Specified by:
setBackgroundColor in interface org.eclipse.jface.text.IInformationControl

isFocusControl

public boolean isFocusControl()
Description copied from interface: org.eclipse.jface.text.IInformationControl
Returns whether this information control has the focus.

Specified by:
isFocusControl in interface org.eclipse.jface.text.IInformationControl

setFocus

public void setFocus()
Description copied from interface: org.eclipse.jface.text.IInformationControl
Sets the keyboard focus to this information control.

Specified by:
setFocus in interface org.eclipse.jface.text.IInformationControl

addFocusListener

public void addFocusListener(org.eclipse.swt.events.FocusListener listener)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Adds the given listener to the list of focus listeners. If the listener is already registered it is not registered again.

Specified by:
addFocusListener in interface org.eclipse.jface.text.IInformationControl

removeFocusListener

public void removeFocusListener(org.eclipse.swt.events.FocusListener listener)
Description copied from interface: org.eclipse.jface.text.IInformationControl
Removes the given listeners from the list of focus listeners. If the listener is not registered this call has no affect.

Specified by:
removeFocusListener in interface org.eclipse.jface.text.IInformationControl

hasContents

public boolean hasContents()
Description copied from interface: org.eclipse.jface.text.IInformationControlExtension
Returns whether this information control has contents to be displayed.

Specified by:
hasContents in interface org.eclipse.jface.text.IInformationControlExtension