diff options
Diffstat (limited to 'examples')
8 files changed, 175 insertions, 0 deletions
diff --git a/examples/org.eclipse.tcf.examples.presentation/.classpath b/examples/org.eclipse.tcf.examples.presentation/.classpath new file mode 100644 index 000000000..ad32c83a7 --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/org.eclipse.tcf.examples.presentation/.project b/examples/org.eclipse.tcf.examples.presentation/.project new file mode 100644 index 000000000..59d1c6166 --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.examples.presentation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.tcf.examples.presentation/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.tcf.examples.presentation/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..f287d53cf --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.tcf.examples.presentation/META-INF/MANIFEST.MF b/examples/org.eclipse.tcf.examples.presentation/META-INF/MANIFEST.MF new file mode 100644 index 000000000..a0eee0703 --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test +Bundle-SymbolicName: org.eclipse.tcf.examples.presentation;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.tcf.examples.presentation.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.tcf.debug.ui, + org.eclipse.tcf +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: org.eclipse.debug.core, + org.eclipse.debug.internal.ui.viewers.model.provisional, + org.eclipse.debug.ui, + org.eclipse.tcf.debug.ui diff --git a/examples/org.eclipse.tcf.examples.presentation/build.properties b/examples/org.eclipse.tcf.examples.presentation/build.properties new file mode 100644 index 000000000..34d2e4d2d --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/examples/org.eclipse.tcf.examples.presentation/plugin.xml b/examples/org.eclipse.tcf.examples.presentation/plugin.xml new file mode 100644 index 000000000..c1635b2ab --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/plugin.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.2"?> +<plugin> + + <extension point="org.eclipse.tcf.debug.ui.presentation_provider"> + <class name="org.eclipse.tcf.examples.presentation.PresentationExample"/> + </extension> + +</plugin> diff --git a/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/Activator.java b/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/Activator.java new file mode 100644 index 000000000..c6a33ad12 --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/Activator.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2012 Xilinx, Inc. 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: + * Xilinx - initial API and implementation + *******************************************************************************/ +package org.eclipse.tcf.examples.presentation; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.tcf.examples.presentation"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public Activator() { + } + + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static Activator getDefault() { + return plugin; + } +} diff --git a/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/PresentationExample.java b/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/PresentationExample.java new file mode 100644 index 000000000..904546701 --- /dev/null +++ b/examples/org.eclipse.tcf.examples.presentation/src/org/eclipse/tcf/examples/presentation/PresentationExample.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2012 Xilinx, Inc. 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: + * Xilinx - initial API and implementation + *******************************************************************************/ +package org.eclipse.tcf.examples.presentation; + +import org.eclipse.debug.core.IRequest; +import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.IDebugUIConstants; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.tcf.debug.ui.ITCFModel; +import org.eclipse.tcf.debug.ui.ITCFPresentationProvider; + +/** + * This example demonstrates how to provide icons in the Registers view. + * Using this approach, clients can alter all aspects of TCF debug model presentation. + */ +@SuppressWarnings("restriction") +public class PresentationExample implements ITCFPresentationProvider { + + @Override + public boolean onModelCreated(ITCFModel model) { + /* true means we want to listen for UI requests on this model */ + return true; + } + + @Override + public void onModelDisposed(ITCFModel model) { + } + + @Override + public boolean updateStarted(IRequest request) { + /* true means we want the model to start handling of this request */ + return true; + } + + @Override + public boolean updateComplete(IRequest request) { + if (request instanceof ILabelUpdate) { + ILabelUpdate update = (ILabelUpdate)request; + String id = update.getPresentationContext().getId(); + if (IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) { + /* This request is for label in the Registers view. + * Let's override the default icon with something else. + */ + ImageDescriptor image = DebugUITools.getImageDescriptor( + IDebugUIConstants.IMG_OBJS_VARIABLE); + update.setImageDescriptor(image, 0); + } + } + /* true means we want the model to finish handling of this request */ + return true; + } +} |