org.eclipse.ui.actions.RenameResourceAction Java Examples
The following examples show how to use
org.eclipse.ui.actions.RenameResourceAction.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RenameHandler.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public Object execute(ExecutionEvent event) throws ExecutionException { Repository repo = RepositoryManager.getInstance().getCurrentRepository(); Optional<IRenamable> renamable = selectionFinder.findElementToRename(repo); if (renamable.isPresent()) { renamable .ifPresent(elementToRename -> elementToRename.retrieveNewName().ifPresent(elementToRename::rename)); } else if(selectionFinder.getCurrentStructuredSelection().isPresent()){ RenameResourceAction renameResourceAction = new RenameResourceAction( PlatformUI.getWorkbench().getActiveWorkbenchWindow()); renameResourceAction.selectionChanged(selectionFinder.getCurrentStructuredSelection().get()); renameResourceAction.run(); } return null; }
Example #2
Source File: RenameXdsResourceHandler.java From xds-ide with Eclipse Public License 1.0 | 4 votes |
public RenameXdsResourceHandler () { super(); setAction(new RenameResourceAction(shellProvider)); }