org.eclipse.xtext.ui.editor.outline.quickoutline
Class QuickOutlinePopup

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.PopupDialog
          extended by org.eclipse.xtext.ui.editor.outline.quickoutline.QuickOutlinePopup
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.window.IShellProvider, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.internal.SWTEventListener

public class QuickOutlinePopup
extends org.eclipse.jface.dialogs.PopupDialog
implements org.eclipse.swt.events.DisposeListener

Author:
Peter Friese - Initial contribution and API, Jan Koehnlein - Adaption to new outline architecture

Nested Class Summary
protected  class QuickOutlinePopup.NamePatternFilter
           
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.jface.dialogs.PopupDialog
HOVER_SHELLSTYLE, INFOPOPUP_SHELLSTYLE, INFOPOPUPRESIZE_SHELLSTYLE, POPUP_HORIZONTALSPACING, POPUP_IMG_MENU, POPUP_IMG_MENU_DISABLED, POPUP_MARGINHEIGHT, POPUP_MARGINWIDTH, POPUP_VERTICALSPACING
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
QuickOutlinePopup()
           
QuickOutlinePopup(org.eclipse.swt.widgets.Shell parent)
           
 
Method Summary
 void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
           
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the contents of the dialog (the area below the title area and above the info text area.
protected  org.eclipse.swt.widgets.Text createFilterText(org.eclipse.swt.widgets.Composite parent)
           
protected  org.eclipse.swt.widgets.Control createTitleControl(org.eclipse.swt.widgets.Composite parent)
          Creates the control to be used to represent the dialog's title text.
protected  org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent, int style)
           
 void dispose()
           
protected  java.lang.Object findMatchingElement(java.lang.Object[] elements)
           
protected  org.eclipse.swt.graphics.Point getDefaultLocation(org.eclipse.swt.graphics.Point initialSize)
          Returns the default location to use for the shell.
protected  org.eclipse.jface.dialogs.IDialogSettings getDialogSettings()
          Gets the dialog settings that should be used for remembering the bounds of the dialog.
protected  org.eclipse.swt.widgets.Control getFocusControl()
          Returns the control that should get initial focus.
protected  StringMatcher getMatcher()
           
protected  java.lang.Object getSelectedElement()
           
protected  boolean hasMatcher()
           
 void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
           
protected  void selectFirstMatch()
           
 void setEditor(XtextEditor xtextEditor)
           
 void setInput(IXtextDocument document)
           
protected  void setMatcherString(java.lang.String pattern, boolean update)
           
protected  void stringMatcherUpdated()
           
 void widgetDisposed(org.eclipse.swt.events.DisposeEvent event)
          Sent when the widget is disposed.
 
Methods inherited from class org.eclipse.jface.dialogs.PopupDialog
adjustBounds, applyBackgroundColor, applyForegroundColor, close, configureShell, createContents, createInfoTextArea, createTitleMenuArea, fillDialogMenu, getBackground, getBackgroundColorExclusions, getDefaultSize, getForeground, getForegroundColorExclusions, getInitialLocation, getInitialSize, getPersistBounds, getPersistLocation, getPersistSize, hasInfoArea, hasTitleArea, open, saveDialogBounds, setInfoText, setTabOrder, setTitleText, showDialogMenu
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, create, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, initializeBounds, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickOutlinePopup

public QuickOutlinePopup()

QuickOutlinePopup

public QuickOutlinePopup(org.eclipse.swt.widgets.Shell parent)
Method Detail

createTitleControl

protected org.eclipse.swt.widgets.Control createTitleControl(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.dialogs.PopupDialog
Creates the control to be used to represent the dialog's title text. Subclasses may override if a different control is desired for representing the title text, or if something different than the title should be displayed in location where the title text typically is shown.

If this method is overridden, the returned control's layout data must be an instance of GridData. This method must not modify the parent's layout.

Overrides:
createTitleControl in class org.eclipse.jface.dialogs.PopupDialog
Parameters:
parent - The parent composite.
Returns:
The Control representing the title area.

createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.dialogs.PopupDialog
Creates and returns the contents of the dialog (the area below the title area and above the info text area.

The PopupDialog implementation of this framework method creates and returns a new Composite with standard margins and spacing.

The returned control's layout data must be an instance of GridData. This method must not modify the parent's layout.

Subclasses must override this method but may call super as in the following example:

 Composite composite = (Composite) super.createDialogArea(parent);
 //add controls to composite as necessary
 return composite;
 

Overrides:
createDialogArea in class org.eclipse.jface.dialogs.PopupDialog
Parameters:
parent - the parent composite to contain the dialog area
Returns:
the dialog area control

createTreeViewer

protected org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent,
                                                                int style)

createFilterText

protected org.eclipse.swt.widgets.Text createFilterText(org.eclipse.swt.widgets.Composite parent)

getFocusControl

protected org.eclipse.swt.widgets.Control getFocusControl()
Description copied from class: org.eclipse.jface.dialogs.PopupDialog
Returns the control that should get initial focus. Subclasses may override this method.

Overrides:
getFocusControl in class org.eclipse.jface.dialogs.PopupDialog
Returns:
the Control that should receive focus when the popup opens.

getMatcher

protected StringMatcher getMatcher()

hasMatcher

protected boolean hasMatcher()

setMatcherString

protected void setMatcherString(java.lang.String pattern,
                                boolean update)

stringMatcherUpdated

protected void stringMatcherUpdated()

selectFirstMatch

protected void selectFirstMatch()

findMatchingElement

protected java.lang.Object findMatchingElement(java.lang.Object[] elements)

getSelectedElement

protected java.lang.Object getSelectedElement()

dispose

public final void dispose()

addDisposeListener

public void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)

removeDisposeListener

public void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)

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
Parameters:
event - an event containing information about the dispose

setInput

public void setInput(IXtextDocument document)

getDefaultLocation

protected org.eclipse.swt.graphics.Point getDefaultLocation(org.eclipse.swt.graphics.Point initialSize)
Description copied from class: org.eclipse.jface.dialogs.PopupDialog
Returns the default location to use for the shell. This default location is used if the dialog does not have any persisted location to restore. The default implementation uses the location computed by Window.getInitialLocation(Point). Subclasses should override this method when an alternate default location is desired, rather than overriding PopupDialog.getInitialLocation(Point).

Overrides:
getDefaultLocation in class org.eclipse.jface.dialogs.PopupDialog
Parameters:
initialSize - the initial size of the shell, as returned by getInitialSize.
Returns:
the initial location of the shell
See Also:
PopupDialog.getPersistLocation()

getDialogSettings

protected org.eclipse.jface.dialogs.IDialogSettings getDialogSettings()
Description copied from class: org.eclipse.jface.dialogs.PopupDialog
Gets the dialog settings that should be used for remembering the bounds of the dialog. Subclasses should override this method when they wish to persist the bounds of the dialog.

Overrides:
getDialogSettings in class org.eclipse.jface.dialogs.PopupDialog
Returns:
settings the dialog settings used to store the dialog's location and/or size, or null if the dialog's bounds should never be stored.

setEditor

public void setEditor(XtextEditor xtextEditor)