org.eclipse.xtext.xbase.ui.hover
Class XbaseInformationControl

java.lang.Object
  extended by org.eclipse.jface.text.AbstractInformationControl
      extended by org.eclipse.xtext.xbase.ui.hover.XbaseInformationControl
All Implemented Interfaces:
org.eclipse.jface.text.IDelayedInputChangeProvider, org.eclipse.jface.text.IInformationControl, org.eclipse.jface.text.IInformationControlExtension, org.eclipse.jface.text.IInformationControlExtension2, org.eclipse.jface.text.IInformationControlExtension3, org.eclipse.jface.text.IInformationControlExtension4, org.eclipse.jface.text.IInformationControlExtension5, IXtextBrowserInformationControl

public class XbaseInformationControl
extends org.eclipse.jface.text.AbstractInformationControl
implements org.eclipse.jface.text.IInformationControlExtension2, org.eclipse.jface.text.IDelayedInputChangeProvider, IXtextBrowserInformationControl

Since:
2.3
Author:
Holger Schill - Initial contribution and API most of the code is copied from

Nested Class Summary
 class XbaseInformationControl.HoverEditedResourceProvider
          Creates the synthetic resource for the embedded editor Allows to set the ClasspathContext afterwards
 
Constructor Summary
XbaseInformationControl(org.eclipse.swt.widgets.Shell parent, java.lang.String symbolicFontName, java.lang.String statusFieldText, XbaseHoverConfiguration xbaseHoverConfiguration)
          Xbase - modification Added XbaseHoverConfiguration because we do not have DI here
XbaseInformationControl(org.eclipse.swt.widgets.Shell parent, java.lang.String symbolicFontName, org.eclipse.jface.action.ToolBarManager toolBarManager, XbaseHoverConfiguration xbaseHoverConfiguration)
          Xbase - modification Added XbaseHoverConfiguration because we do not have DI here
 
Method Summary
 void addInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
          Adds a listener for input changes to this input change provider.
 void addLocationListener(org.eclipse.swt.browser.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.
 org.eclipse.swt.graphics.Point computeSizeConstraints(int widthInChars, int heightInChars)
          Xbase - modification
 org.eclipse.swt.graphics.Point computeSizeHint()
          Xbase - modification added some space for the detailPane
 org.eclipse.swt.graphics.Rectangle computeTrim()
           
protected  void createContent(org.eclipse.swt.widgets.Composite parent)
          Xbase - modification+ added detailPane
 XtextBrowserInformationControlInput getInput()
          Xbase - modification
 boolean hasContents()
           
 boolean hasDelayedInputChangeListener()
          Tells whether a delayed input change listener is registered.
static boolean isAvailable(org.eclipse.swt.widgets.Composite parent)
          Tells whether the SWT Browser widget and hence this information control is available.
 void notifyDelayedInputChange(java.lang.Object newInput)
          Notifies listeners of a delayed input change.
 void removeInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
          Removes the given input change listener from this input change provider.
 void setDelayedInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
           
 void setInput(java.lang.Object input)
          Xbase - modification added detailPane
 void setSize(int width, int height)
           
 void setVisible(boolean visible)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.jface.text.AbstractInformationControl
addDisposeListener, addFocusListener, containsControl, create, dispose, getBounds, getInformationPresenterControlCreator, getShell, getSizeConstraints, getToolBarManager, isFocusControl, isResizable, isVisible, removeDisposeListener, removeFocusListener, restoresLocation, restoresSize, setBackgroundColor, setFocus, setForegroundColor, setInformation, setLocation, setSizeConstraints, setStatusText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtext.ui.editor.hover.html.IXtextBrowserInformationControl
dispose
 
Methods inherited from interface org.eclipse.jface.text.IInformationControl
addDisposeListener, addFocusListener, isFocusControl, removeDisposeListener, removeFocusListener, setBackgroundColor, setFocus, setForegroundColor, setInformation, setLocation, setSizeConstraints
 

Constructor Detail

XbaseInformationControl

public XbaseInformationControl(org.eclipse.swt.widgets.Shell parent,
                               java.lang.String symbolicFontName,
                               java.lang.String statusFieldText,
                               XbaseHoverConfiguration xbaseHoverConfiguration)
Xbase - modification Added XbaseHoverConfiguration because we do not have DI here


XbaseInformationControl

public XbaseInformationControl(org.eclipse.swt.widgets.Shell parent,
                               java.lang.String symbolicFontName,
                               org.eclipse.jface.action.ToolBarManager toolBarManager,
                               XbaseHoverConfiguration xbaseHoverConfiguration)
Xbase - modification Added XbaseHoverConfiguration because we do not have DI here

Method Detail

createContent

protected void createContent(org.eclipse.swt.widgets.Composite parent)
Xbase - modification+ added detailPane

Specified by:
createContent in class org.eclipse.jface.text.AbstractInformationControl

setInput

public void setInput(java.lang.Object input)
Xbase - modification added detailPane

Specified by:
setInput in interface org.eclipse.jface.text.IInformationControlExtension2
Specified by:
setInput in interface IXtextBrowserInformationControl

computeSizeHint

public org.eclipse.swt.graphics.Point computeSizeHint()
Xbase - modification added some space for the detailPane

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

getInput

public XtextBrowserInformationControlInput getInput()
Xbase - modification

Specified by:
getInput in interface IXtextBrowserInformationControl

computeSizeConstraints

public org.eclipse.swt.graphics.Point computeSizeConstraints(int widthInChars,
                                                             int heightInChars)
Xbase - modification

Specified by:
computeSizeConstraints in interface org.eclipse.jface.text.IInformationControlExtension5
Overrides:
computeSizeConstraints in class org.eclipse.jface.text.AbstractInformationControl

isAvailable

public static boolean isAvailable(org.eclipse.swt.widgets.Composite parent)
Tells whether the SWT Browser widget and hence this information control is available.

Parameters:
parent - the parent component used for checking or null if none
Returns:
true if this control is available

setVisible

public void setVisible(boolean visible)
Specified by:
setVisible in interface org.eclipse.jface.text.IInformationControl
Overrides:
setVisible in class org.eclipse.jface.text.AbstractInformationControl

setSize

public void setSize(int width,
                    int height)
Specified by:
setSize in interface org.eclipse.jface.text.IInformationControl
Overrides:
setSize in class org.eclipse.jface.text.AbstractInformationControl

computeTrim

public org.eclipse.swt.graphics.Rectangle computeTrim()
Specified by:
computeTrim in interface org.eclipse.jface.text.IInformationControlExtension3
Overrides:
computeTrim in class org.eclipse.jface.text.AbstractInformationControl

addLocationListener

public void addLocationListener(org.eclipse.swt.browser.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.

Specified by:
addLocationListener in interface IXtextBrowserInformationControl
Parameters:
listener - the location listener
Since:
3.4

hasContents

public boolean hasContents()
Specified by:
hasContents in interface org.eclipse.jface.text.IInformationControlExtension

addInputChangeListener

public void addInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
Adds a listener for input changes to this input change provider. Has no effect if an identical listener is already registered.

Specified by:
addInputChangeListener in interface IXtextBrowserInformationControl
Parameters:
inputChangeListener - the listener to add
Since:
3.4

removeInputChangeListener

public void removeInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
Removes the given input change listener from this input change provider. Has no effect if an identical listener is not registered.

Parameters:
inputChangeListener - the listener to remove
Since:
3.4

setDelayedInputChangeListener

public void setDelayedInputChangeListener(org.eclipse.jface.text.IInputChangedListener inputChangeListener)
Specified by:
setDelayedInputChangeListener in interface org.eclipse.jface.text.IDelayedInputChangeProvider

hasDelayedInputChangeListener

public boolean hasDelayedInputChangeListener()
Tells whether a delayed input change listener is registered.

Specified by:
hasDelayedInputChangeListener in interface IXtextBrowserInformationControl
Returns:
true if a delayed input change listener is currently registered
Since:
3.4

notifyDelayedInputChange

public void notifyDelayedInputChange(java.lang.Object newInput)
Notifies listeners of a delayed input change.

Specified by:
notifyDelayedInputChange in interface IXtextBrowserInformationControl
Parameters:
newInput - the new input, or null to request cancellation
Since:
3.4

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object