Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2021-03-30 19:06:08 +0000
committerEugene Tarassov2021-03-30 19:06:08 +0000
commit79a7e26d120396d94dd6c200384a03291621c574 (patch)
treea52a44cf1bcbcbf2202e78089a779eb30593b7f3
parentca9666432feaa3466586b1d9a923919c51b0cb1d (diff)
downloadorg.eclipse.tcf-79a7e26d120396d94dd6c200384a03291621c574.tar.gz
org.eclipse.tcf-79a7e26d120396d94dd6c200384a03291621c574.tar.xz
org.eclipse.tcf-79a7e26d120396d94dd6c200384a03291621c574.zip
TCF Debugger: code cleanup
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/EvaluationContextManager.java37
1 files changed, 8 insertions, 29 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/EvaluationContextManager.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/EvaluationContextManager.java
index 06ff98ae7..bbf4d93da 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/EvaluationContextManager.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/EvaluationContextManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2013 QNX Software Systems and others.
+ * Copyright (c) 2004-2021 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -81,38 +81,22 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
public void windowActivated(IWorkbenchWindow window) {
- IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
- service.addDebugContextListener(this);
- selectionChanged( service.getActiveContext() );
+ IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
+ service.addDebugContextListener(this);
+ selectionChanged( service.getActiveContext() );
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
public void windowDeactivated(IWorkbenchWindow window) {
DebugUITools.getDebugContextManager().getContextService(window).removeDebugContextListener(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
public void windowOpened(IWorkbenchWindow window) {
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
public void windowClosed(IWorkbenchWindow window) {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
public void debugContextChanged(DebugContextEvent event) {
selectionChanged(event.getContext());
}
@@ -146,16 +130,11 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
@SuppressWarnings("unchecked")
private <T> T adapt(Object adaptable, Class<T> clazz) {
- if (adaptable == null)
- return null;
- if (clazz.isInstance(adaptable))
- return (T) adaptable;
+ if (adaptable == null) return null;
+ if (clazz.isInstance(adaptable)) return (T) adaptable;
T adapter = null;
- if (adaptable instanceof IAdaptable)
- adapter = (T) ((IAdaptable) adaptable).getAdapter(clazz);
- if (adapter == null)
- adapter = (T) Platform.getAdapterManager().loadAdapter(adaptable, clazz.getName());
+ if (adaptable instanceof IAdaptable) adapter = (T) ((IAdaptable) adaptable).getAdapter(clazz);
+ if (adapter == null) adapter = (T) Platform.getAdapterManager().loadAdapter(adaptable, clazz.getName());
return adapter;
}
-
}

Back to the top