use of org.eclipse.e4.core.commands.ECommandService in project eclipse.platform.text by eclipse.
the class ShowInSystemExplorerHyperlink method open.
@Override
public void open() {
ECommandService commandService = PlatformUI.getWorkbench().getService(ECommandService.class);
EHandlerService handlerService = PlatformUI.getWorkbench().getService(EHandlerService.class);
Command command = commandService.getCommand(ShowInSystemExplorerHandler.ID);
if (command.isDefined()) {
ParameterizedCommand parameterizedCommand = commandService.createCommand(ShowInSystemExplorerHandler.ID, Collections.singletonMap(ShowInSystemExplorerHandler.RESOURCE_PATH_PARAMETER, fileLocation));
if (handlerService.canExecute(parameterizedCommand)) {
handlerService.executeHandler(parameterizedCommand);
}
}
}
Aggregations