Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.examples.ui')
-rw-r--r--org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.debug.examples.ui/pom.xml4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java34
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java22
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java12
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java8
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java17
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java4
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java17
10 files changed, 68 insertions, 58 deletions
diff --git a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
index 4da298606..b9f6282ac 100644
--- a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
@@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.debug.examples.ui;singleton:=true
-Bundle-Version: 1.4.200.qualifier
+Bundle-Version: 1.4.300.qualifier
Bundle-Activator: org.eclipse.debug.examples.ui.pda.DebugUIPlugin
-Require-Bundle: org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)",
org.eclipse.core.resources,
org.eclipse.debug.core;bundle-version="3.9.0",
org.eclipse.ui,
diff --git a/org.eclipse.debug.examples.ui/pom.xml b/org.eclipse.debug.examples.ui/pom.xml
index 3a5eeee65..ff5890bfe 100644
--- a/org.eclipse.debug.examples.ui/pom.xml
+++ b/org.eclipse.debug.examples.ui/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2013 Eclipse Foundation and others.
+ Copyright (c) 2012, 2015 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.debug</groupId>
<artifactId>org.eclipse.debug.examples.ui</artifactId>
- <version>1.4.200-SNAPSHOT</version>
+ <version>1.4.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
index b3dfbbead..db3b6ab71 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import javax.sound.midi.MidiEvent;
import javax.sound.midi.Track;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.commands.IStepOverHandler;
import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch;
import org.eclipse.debug.examples.core.midi.launcher.SequencerControl;
@@ -50,63 +51,64 @@ public class MidiAdapterFactory implements IAdapterFactory {
private static IModelProxyFactory fgCheckboxModelProxyFactory = new CheckboxModelProxyFactory();
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerContentProvider;
+ return (T) fgSequencerContentProvider;
}
if (adaptableObject instanceof Track) {
- return fgTackContentProvider;
+ return (T) fgTackContentProvider;
}
}
if (IElementLabelProvider.class.equals(adapterType)) {
if (adaptableObject instanceof Track) {
- return fgTrackLabelProvider;
+ return (T) fgTrackLabelProvider;
}
if (adaptableObject instanceof SequencerControl) {
- return fgControlLabelProvider;
+ return (T) fgControlLabelProvider;
}
if (adaptableObject instanceof MidiEvent) {
- return fgMidiEventLabelProvdier;
+ return (T) fgMidiEventLabelProvdier;
}
}
if (IColumnPresentationFactory.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerColumnFactory;
+ return (T) fgSequencerColumnFactory;
}
if (adaptableObject instanceof Track) {
- return fgTrackColumnFactory;
+ return (T) fgTrackColumnFactory;
}
}
if (IElementEditor.class.equals(adapterType)) {
if (adaptableObject instanceof SequencerControl) {
- return new ControlEditor();
+ return (T) new ControlEditor();
}
}
if (IModelProxyFactory.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
- return fgSequencerModelProxyFactory;
+ return (T) fgSequencerModelProxyFactory;
} else if (adaptableObject instanceof Track) {
- return fgCheckboxModelProxyFactory;
+ return (T) fgCheckboxModelProxyFactory;
} else if (adaptableObject instanceof MidiEvent) {
- return fgCheckboxModelProxyFactory;
+ return (T) fgCheckboxModelProxyFactory;
}
}
if (IElementMementoProvider.class.equals(adapterType)) {
- return fgMementoProvider;
+ return (T) fgMementoProvider;
}
if (IStepOverHandler.class.equals(adapterType)) {
- return fgStepOverHandler;
+ return (T) fgStepOverHandler;
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IElementContentProvider.class, IElementLabelProvider.class, IStepOverHandler.class,};
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
index 02a382c5c..b7b756f46 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Bjorn Freeman-Benson - initial API and implementation
@@ -12,6 +12,7 @@
package org.eclipse.debug.examples.ui.pda.adapters;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
import org.eclipse.debug.examples.core.pda.model.PDAStackFrame;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
@@ -20,38 +21,39 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewActionProvid
/**
- *
+ *
* @since 3.2
*
*/
public class AdapterFactory implements IAdapterFactory {
-
+
private static IElementContentProvider fgTargetAdapter = new PDADebugTargetContentProvider();
private static IModelProxyFactory fgFactory = new ModelProxyFactory();
private static IViewActionProvider fgViewActionProvider = new PDAViewActionProvider();
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgTargetAdapter;
+ return (T) fgTargetAdapter;
}
}
if (IModelProxyFactory.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgFactory;
+ return (T) fgFactory;
}
}
if (IViewActionProvider.class.equals(adapterType)) {
if (adaptableObject instanceof PDAStackFrame) {
- return fgViewActionProvider;
+ return (T) fgViewActionProvider;
}
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IElementContentProvider.class, IModelProxyFactory.class, IViewActionProvider.class};
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
index 3eed074e3..e3da52e57 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
+ * Copyright (c) 2009, 2015 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.debug.examples.ui.pda.adapters;
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.core.commands.IRestartHandler;
import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
@@ -24,18 +25,19 @@ public class CommandAdapterFactory implements IAdapterFactory {
private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IRestartHandler.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
- return fgRestartHandler;
+ return (T) fgRestartHandler;
}
}
return null;
}
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IRestartHandler.class};
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
index ca4706959..1486e78ff 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,7 +42,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
ITextEditor textEditor = getEditor(part);
if (textEditor != null) {
- IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IResource.class);
+ IResource resource = textEditor.getEditorInput().getAdapter(IResource.class);
ITextSelection textSelection = (ITextSelection) selection;
int lineNumber = textSelection.getStartLine();
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL);
@@ -80,7 +80,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
private ITextEditor getEditor(IWorkbenchPart part) {
if (part instanceof ITextEditor) {
ITextEditor editorPart = (ITextEditor) part;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
if (resource != null) {
String extension = resource.getFileExtension();
if (extension != null && extension.equals("pda")) { //$NON-NLS-1$
@@ -113,7 +113,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
ITextEditor editorPart = (ITextEditor)part;
int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
String var = variableAndFunctionName[0];
String fcn = variableAndFunctionName[1];
toggleWatchpoint(resource, lineNumber, fcn, var, true, true);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
index a81d6d2c8..22243aabd 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,10 +12,14 @@
package org.eclipse.debug.examples.ui.pda.breakpoints;
import org.eclipse.core.resources.IResource;
+
import org.eclipse.core.runtime.IAdapterFactory;
+
import org.eclipse.debug.examples.ui.pda.editor.PDAEditor;
+
import org.eclipse.debug.ui.actions.IRunToLineTarget;
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
+
import org.eclipse.ui.texteditor.ITextEditor;
@@ -26,22 +30,23 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adaptableObject instanceof PDAEditor) {
ITextEditor editorPart = (ITextEditor) adaptableObject;
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
if (resource != null) {
String extension = resource.getFileExtension();
if (extension != null && extension.equals("pda")) { //$NON-NLS-1$
if (adapterType.equals(IToggleBreakpointsTarget.class)) {
- return new PDABreakpointAdapter();
+ return (T) new PDABreakpointAdapter();
}
//#ifdef ex7
//# // TODO: Exercise 7 - create run to line adapter
//#else
if (adapterType.equals(IRunToLineTarget.class)) {
- return new PDARunToLineAdapter();
+ return (T) new PDARunToLineAdapter();
}
//#endif
}
@@ -53,7 +58,7 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@Override
- public Class[] getAdapterList() {
+ public Class<?>[] getAdapterList() {
return new Class[]{IToggleBreakpointsTarget.class};
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
index 9855de3c2..6a9eecdd9 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,7 +47,7 @@ public class PDARunToLineAdapter implements IRunToLineTarget {
int lineNumber = textSelection.getStartLine() + 1;
if (lineNumber > 0) {
if (target instanceof IAdaptable) {
- IDebugTarget debugTarget = (IDebugTarget) ((IAdaptable)target).getAdapter(IDebugTarget.class);
+ IDebugTarget debugTarget = ((IAdaptable)target).getAdapter(IDebugTarget.class);
if (debugTarget != null) {
//#ifdef ex7
//# // TODO: Exercise 7 - perform the run-to-line with a run-to-line breakpoint and handler
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
index 2e716724c..d799e50bf 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -72,7 +72,7 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
// current source line.
ITextEditor editorPart = (ITextEditor)part;
int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class);
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
String var = variableAndFunctionName[0];
String fcn = variableAndFunctionName[1];
toggleWatchpoint(resource, lineNumber, fcn, var, fAccessModeEnabled, fModificationModeEnabled);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
index c937d1493..b2b0ee939 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Wind River Systems and others.
+ * Copyright (c) 2008, 2015 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* IBM Corporation - bug fixing
@@ -18,26 +18,25 @@ import org.eclipse.debug.examples.core.pda.model.PDAStackFrame;
import org.eclipse.debug.examples.core.pda.model.PDAThread;
/**
- * Property tester for use with standard expressions to determine whether
+ * Property tester for use with standard expressions to determine whether
* the given debug target can perform a push operation.
*/
public class CanPushTester extends PropertyTester {
-
+
private static final String CAN_PUSH_PROPERTY = "canPush"; //$NON-NLS-1$
-
+
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (CAN_PUSH_PROPERTY.equals(property)) {
if (receiver instanceof IAdaptable) {
- PDADebugElement element = (PDADebugElement)
- ((IAdaptable)receiver).getAdapter(PDADebugElement.class);
+ PDADebugElement element = ((IAdaptable) receiver).getAdapter(PDADebugElement.class);
PDAThread thread = null;
if (element instanceof PDAThread) {
thread = (PDAThread)element;
} else if (element instanceof PDAStackFrame) {
thread = (PDAThread)((PDAStackFrame)element).getThread();
- }
-
+ }
+
if (thread != null) {
return thread.canPushData();
}

Back to the top