Class RenameSourceElementHandler
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- com._1c.g5.ides.ui.refactoring.xtext.RenameSourceElementHandler
-
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler
,org.eclipse.core.commands.IHandler2
public class RenameSourceElementHandler extends org.eclipse.core.commands.AbstractHandler
Starts rename refactoring for the currently selected Xtext-based source element.Note that this handler understands structured selections only; use
CustomRenameElementHandler
to activate rename refactoring from an Xtext editor.Also note that
CustomRenameSupport
must be bound for the language that declares the renamed source element, or else an NPE shall occur.- See Also:
IXtextFile
,ISourceElement
-
-
Constructor Summary
Constructors Constructor Description RenameSourceElementHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
execute(org.eclipse.core.commands.ExecutionEvent event)
protected boolean
isEnabledFor(org.eclipse.handly.model.ISourceElement targetElement)
Returns whether rename refactoring can be started for the given source element.void
setEnabled(Object evaluationContext)
protected void
startRenameElement(org.eclipse.handly.model.ISourceElement targetElement)
Starts rename refactoring for the given source element.-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled
-
-
-
-
Method Detail
-
execute
public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
- Throws:
org.eclipse.core.commands.ExecutionException
-
setEnabled
public void setEnabled(Object evaluationContext)
- Specified by:
setEnabled
in interfaceorg.eclipse.core.commands.IHandler2
- Overrides:
setEnabled
in classorg.eclipse.core.commands.AbstractHandler
-
startRenameElement
protected void startRenameElement(org.eclipse.handly.model.ISourceElement targetElement) throws InterruptedException
Starts rename refactoring for the given source element.- Parameters:
targetElement
- notnull
- Throws:
InterruptedException
- if the initial condition checking got canceled by the user
-
isEnabledFor
protected boolean isEnabledFor(org.eclipse.handly.model.ISourceElement targetElement)
Returns whether rename refactoring can be started for the given source element.- Parameters:
targetElement
- notnull
- Returns:
true
if rename refactoring can be started;false
otherwise
-
-