*/
public static IEvaluationContext createEvaluationContext(Object defaultvar) {
IEvaluationContext parent = null;
- IEvaluationService esrvc = (IEvaluationService)PlatformUI.getWorkbench().getService(IEvaluationService.class);
+ IEvaluationService esrvc = PlatformUI.getWorkbench().getService(IEvaluationService.class);
if (esrvc != null) {
parent = esrvc.getCurrentState();
}
fViewSite = viewSite;
setEnabled(false);
- IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
+ IHandlerService service = fViewSite.getService(IHandlerService.class);
ActionHandler handler = new ActionHandler(this);
fHandlerActivation = service.activateHandler(getActionDefinitionId(), handler);
}
public void dispose() {
- IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
+ IHandlerService service = fViewSite.getService(IHandlerService.class);
service.deactivateHandler(fHandlerActivation);
}
protected IDebugContextService createService(IWorkbenchWindow window) {
DebugWindowContextService service = fServices.get(window);
if (service == null) {
- IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
+ IEvaluationService evaluationService = window.getService(IEvaluationService.class);
if (window.getShell() == null || evaluationService == null) {
// the window has been closed - return a dummy service
return NULL_SERVICE;
// add EOF submissions
IPageSite site = fPage.getSite();
if(fActivatedContext == null && fActivatedHandler == null) {
- IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
- IContextService contextService = (IContextService)site.getService(IContextService.class);
+ IHandlerService handlerService = site.getService(IHandlerService.class);
+ IContextService contextService = site.getService(IContextService.class);
fActivatedContext = contextService.activateContext(fContextId);
fActivatedHandler = handlerService.activateHandler("org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$
}
public void deactivated() {
// remove EOF submissions
IPageSite site = fPage.getSite();
- IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
- IContextService contextService = (IContextService)site.getService(IContextService.class);
+ IHandlerService handlerService = site.getService(IHandlerService.class);
+ IContextService contextService = site.getService(IContextService.class);
handlerService.deactivateHandler(fActivatedHandler);
contextService.deactivateContext(fActivatedContext);
fActivatedContext = null;
super.init(site);
commonInit(site);
preferenceInit(site);
- fContextService = (IContextService)site.getService(IContextService.class);
+ fContextService = site.getService(IContextService.class);
}
/* (non-Javadoc)
super.init(site, memento);
commonInit(site);
preferenceInit(site);
- fContextService = (IContextService)site.getService(IContextService.class);
+ fContextService = site.getService(IContextService.class);
}
/* (non-Javadoc)
}
public void activateHandlers() {
- ICommandService commandSupport = (ICommandService) getSite().getService(ICommandService.class);
- IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
- IContextService contextSupport = (IContextService) getSite().getService(IContextService.class);
+ ICommandService commandSupport = getSite().getService(ICommandService.class);
+ IHandlerService handlerService = getSite().getService(IHandlerService.class);
+ IContextService contextSupport = getSite().getService(IContextService.class);
if (commandSupport != null && handlerService != null && contextSupport != null) {
contextSupport.activateContext(ID_MEMORY_VIEW_CONTEXT);
action = new CollapseAllAction((TreeModelViewer)getViewer());
setAction(COLLAPSE_ALL, action);
- IHandlerService hs = (IHandlerService) getSite().getService(IHandlerService.class);
+ IHandlerService hs = getSite().getService(IHandlerService.class);
if (hs != null) {
hs.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(action));
}
textAction.setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST));
PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_CONTENT_ASSIST_ACTION);
ActionHandler actionHandler = new ActionHandler(textAction);
- IHandlerService handlerService = (IHandlerService) getViewSite().getService(IHandlerService.class);
+ IHandlerService handlerService = getViewSite().getService(IHandlerService.class);
fContentAssistActivation = handlerService.activateHandler(textAction.getActionDefinitionId(), actionHandler);
setAction(DETAIL_CONTENT_ASSIST_ACTION, textAction);
((DetailPaneAssignValueAction)action).dispose();
}
if (fContentAssistActivation != null){
- IHandlerService service = (IHandlerService) getViewSite().getService(IHandlerService.class);
+ IHandlerService service = getViewSite().getService(IHandlerService.class);
service.deactivateHandler(fContentAssistActivation);
fContentAssistActivation = null;
}
ISelection selection = null;
ISelectionService selectionService =
- (ISelectionService)fServiceLocator.getService(ISelectionService.class);
+ fServiceLocator.getService(ISelectionService.class);
if (selectionService != null) {
selection = selectionService.getSelection();
}
- IPartService partService = (IPartService)fServiceLocator.getService(IPartService.class);
+ IPartService partService = fServiceLocator.getService(IPartService.class);
if (partService != null) {
part = partService.getActivePart();
}
fAction.setText(getText());\r
fAction.setToolTipText(getTooltipText());\r
String commandId = getCommandId();\r
- ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);\r
+ ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class);\r
if (service != null) {\r
Command command = service.getCommand(commandId);\r
command.undefine();\r
public void partActivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = true;
- IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+ IContextService contextService = getSite().getService(IContextService.class);
if(contextService != null) {
fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW);
activateParticipants(fActiveConsole);
public void partDeactivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = false;
- IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+ IContextService contextService = getSite().getService(IContextService.class);
if(contextService != null) {
contextService.deactivateContext(fActivatedContext);
deactivateParticipants(fActiveConsole);