aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer
diff options
context:
space:
mode:
authorKonstantin Lopyrev <klopyrev@google.com>2010-07-15 18:26:51 -0700
committerKonstantin Lopyrev <klopyrev@google.com>2010-07-16 17:06:26 -0700
commit0f317518ceb4687a14b97c813682b78654033aa8 (patch)
treef948974d47d176512216dc676e3be5f73cbac482 /eclipse/plugins/com.android.ide.eclipse.hierarchyviewer
parent00c8ee85c0e04e4b7c46cdbc88dca7c2dd613430 (diff)
downloadsdk-0f317518ceb4687a14b97c813682b78654033aa8.zip
sdk-0f317518ceb4687a14b97c813682b78654033aa8.tar.gz
sdk-0f317518ceb4687a14b97c813682b78654033aa8.tar.bz2
First commit... Ignore *.java files, they are there just so it builds.
Change-Id: Ibf159c32cee7a770f1c36f387fe646d9ecabe168
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.hierarchyviewer')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.project28
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/MODULE_LICENSE_APACHE20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/build.properties7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/plugin.xml30
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java63
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/SampleView.java120
9 files changed, 271 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath
new file mode 100644
index 0000000..e2c0625
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="libs/hierarchyviewerlib.jar" sourcepath="/ddmlib"/>
+ <classpathentry kind="lib" path="libs/hierarchyvieweruilib.jar" sourcepath="/ddmuilib"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.project b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.project
new file mode 100644
index 0000000..9a33e7b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>hierarchyviewer-plugin</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/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..716c0f4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Hierarchy Viewer
+Bundle-SymbolicName: com.android.ide.eclipse.hierarchyviewer;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin
+Bundle-Vendor: The Android Open Source Project
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,
+ libs/hierarchyviewerlib.jar,
+ libs/hierearchyvieweruilib.jar
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/MODULE_LICENSE_APACHE2 b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/MODULE_LICENSE_APACHE2
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/build.properties b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/build.properties
new file mode 100644
index 0000000..7fce1ca
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ icons/,\
+ plugin.xml,\
+ .,\
+ libs/ \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/icons/sample.gif b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/icons/sample.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/icons/sample.gif
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/plugin.xml
new file mode 100644
index 0000000..06e1f14
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="com.android.ide.eclipse.ddms.views.category"
+ name="Android">
+ </category>
+ <view
+ category="com.android.ide.eclipse.ddms.views.category"
+ class="com.android.ide.eclipse.hierarchyviewer.views.SampleView"
+ icon="icons/sample.gif"
+ id="com.android.ide.eclipse.hierarchyviewer.views.SampleView"
+ name="Sample View">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <view
+ id="com.android.ide.eclipse.hierarchyviewer.views.SampleView"
+ ratio="0.5"
+ relationship="right"
+ relative="org.eclipse.ui.views.TaskList">
+ </view>
+ </perspectiveExtension>
+ </extension>
+</plugin>
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java
new file mode 100644
index 0000000..b6f0ed3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPlugin.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ide.eclipse.hierarchyviewer;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class HierarchyViewerPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "com.android.ide.eclipse.hierarchyviewer";
+
+ // The shared instance
+ private static HierarchyViewerPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public HierarchyViewerPlugin() {
+ }
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static HierarchyViewerPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/SampleView.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/SampleView.java
new file mode 100644
index 0000000..13c7ff4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/SampleView.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ide.eclipse.hierarchyviewer.views;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.core.runtime.jobs.Job;
+
+/**
+ * This sample class demonstrates how to plug-in a new workbench view. The view
+ * shows data obtained from the model. The sample creates a dummy model on the
+ * fly, but a real implementation would connect to the model available either in
+ * this or another plug-in (e.g. the workspace). The view is connected to the
+ * model using a content provider.
+ * <p>
+ * The view uses a label provider to define how model objects should be
+ * presented in the view. Each view can present the same model objects using
+ * different labels and icons, if needed. Alternatively, a single label provider
+ * can be shared between views in order to ensure that objects of the same type
+ * are presented in the same way everywhere.
+ * <p>
+ */
+
+public class SampleView extends ViewPart {
+
+ /**
+ * The ID of the view as specified by the extension.
+ */
+ public static final String ID = "com.android.ide.eclipse.hierarchyviewer.views.SampleView";
+
+ private Text text;
+
+ /**
+ * The constructor.
+ */
+ public SampleView() {
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize
+ * it.
+ */
+ public void createPartControl(Composite parent) {
+ parent.setLayout(new FillLayout());
+ text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.V_SCROLL);
+ text.addMouseListener(new MouseListener() {
+
+ public void mouseDoubleClick(MouseEvent e) {
+ text.setText(text.getText() + "Scheduling\n");
+ Job test = new Job("Simple Job") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ text.setText(text.getText() + "SLEEPING\n");
+ }
+ });
+ Thread.sleep(5000);
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ text.setText(text.getText() + "DONE SLEEPING\n");
+ }
+ });
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+ test.schedule();
+ text.setText(text.getText() + "Done Scheduling\n");
+ }
+
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ });
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ text.setFocus();
+ }
+}