org.eclipse.xtext.ui.refactoring.ui
Class RenameRefactoringPopup

java.lang.Object
  extended by org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringPopup
All Implemented Interfaces:
org.eclipse.jface.text.IWidgetTokenKeeper, org.eclipse.jface.text.IWidgetTokenKeeperExtension

public class RenameRefactoringPopup
extends java.lang.Object
implements org.eclipse.jface.text.IWidgetTokenKeeper, org.eclipse.jface.text.IWidgetTokenKeeperExtension

Author:
Holger Schill - Initial contribution and API

Nested Class Summary
protected  class RenameRefactoringPopup.PopupVisibilityManager
           
 
Constructor Summary
RenameRefactoringPopup(XtextEditor editor, RenameRefactoringController controller, RenameLinkedMode renameLinkedMode)
           
 
Method Summary
protected  void activateEditor()
           
protected  org.eclipse.swt.widgets.ToolBar addViewMenu(org.eclipse.swt.widgets.Composite parent)
           
 void close()
           
protected  org.eclipse.swt.graphics.Point computePopupLocation()
           
protected  void createContent(org.eclipse.swt.widgets.Composite parent)
           
protected static java.lang.String getEnterBinding()
           
protected  org.eclipse.swt.graphics.Point getExtent()
           
protected  org.eclipse.jface.action.MenuManager getMenuManager()
           
protected static java.lang.String getOpenDialogBinding()
          WARNING: only works in workbench window context!
protected  int[] getPolygon(boolean border)
           
 void open()
           
 boolean ownsFocusShell()
           
protected  void packPopup()
           
protected static void recursiveSetBackgroundColor(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color color)
           
protected  void releaseWidgetToken()
           
 boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner)
          The given widget token owner requests the widget token from this token keeper.
 boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner, int priority)
          The given widget token owner requests the widget token from this token keeper.
 boolean setFocus(org.eclipse.jface.text.IWidgetTokenOwner owner)
          Requests the receiver to give focus to its popup shell, hover, or similar.
protected  void showMenu(org.eclipse.swt.widgets.ToolBar toolBar)
           
protected  void updatePopupLocation()
           
protected  void updateVisibility()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameRefactoringPopup

public RenameRefactoringPopup(XtextEditor editor,
                              RenameRefactoringController controller,
                              RenameLinkedMode renameLinkedMode)
Method Detail

updateVisibility

protected void updateVisibility()

releaseWidgetToken

protected void releaseWidgetToken()

open

public void open()

createContent

protected void createContent(org.eclipse.swt.widgets.Composite parent)

recursiveSetBackgroundColor

protected static void recursiveSetBackgroundColor(org.eclipse.swt.widgets.Control control,
                                                  org.eclipse.swt.graphics.Color color)

addViewMenu

protected org.eclipse.swt.widgets.ToolBar addViewMenu(org.eclipse.swt.widgets.Composite parent)

showMenu

protected void showMenu(org.eclipse.swt.widgets.ToolBar toolBar)

getMenuManager

protected org.eclipse.jface.action.MenuManager getMenuManager()

getEnterBinding

protected static java.lang.String getEnterBinding()

computePopupLocation

protected org.eclipse.swt.graphics.Point computePopupLocation()

getExtent

protected org.eclipse.swt.graphics.Point getExtent()

updatePopupLocation

protected void updatePopupLocation()

packPopup

protected void packPopup()

getPolygon

protected int[] getPolygon(boolean border)

getOpenDialogBinding

protected static java.lang.String getOpenDialogBinding()
WARNING: only works in workbench window context!

Returns:
the keybinding for Refactor > Rename

requestWidgetToken

public boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner,
                                  int priority)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeperExtension
The given widget token owner requests the widget token from this token keeper. Returns true if the token is released by this token keeper. Note, the keeper must not call releaseWidgetToken(IWidgetTokenKeeper) explicitly.

The general contract is that the receiver should release the token if priority exceeds the receiver's priority.

Specified by:
requestWidgetToken in interface org.eclipse.jface.text.IWidgetTokenKeeperExtension
Parameters:
owner - the token owner
priority - the priority of the request
Returns:
true if token has been released false otherwise

setFocus

public boolean setFocus(org.eclipse.jface.text.IWidgetTokenOwner owner)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeperExtension
Requests the receiver to give focus to its popup shell, hover, or similar. There is no assumption made whether the receiver actually succeeded in taking the focus. The return value gives a hint whether the receiver tried to take focus.

Specified by:
setFocus in interface org.eclipse.jface.text.IWidgetTokenKeeperExtension
Parameters:
owner - the token owner
Returns:
true if the receiver tried to take focus, false if it did not.

requestWidgetToken

public boolean requestWidgetToken(org.eclipse.jface.text.IWidgetTokenOwner owner)
Description copied from interface: org.eclipse.jface.text.IWidgetTokenKeeper
The given widget token owner requests the widget token from this token keeper. Returns true if the token is released by this token keeper. Note, the keeper must not call releaseWidgetToken(IWidgetTokenKeeper) explicitly.

Replaced by IWidgetTokenKeeperExtension.requestWidgetToken(IWidgetTokenOwner, int).

Specified by:
requestWidgetToken in interface org.eclipse.jface.text.IWidgetTokenKeeper
Parameters:
owner - the token owner
Returns:
true if token has been released false otherwise

ownsFocusShell

public boolean ownsFocusShell()

activateEditor

protected void activateEditor()

close

public void close()