diff options
Diffstat (limited to 'hierarchyviewer2/app')
20 files changed, 0 insertions, 2110 deletions
diff --git a/hierarchyviewer2/app/.classpath b/hierarchyviewer2/app/.classpath deleted file mode 100644 index 2d4a26d..0000000 --- a/hierarchyviewer2/app/.classpath +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/hierarchyviewerlib"/> - <classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/> - <classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/> - <classpathentry combineaccessrules="false" kind="src" path="/sdklib"/> - <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/linux-x86/swt/swt.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/common"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/hierarchyviewer2/app/.gitignore b/hierarchyviewer2/app/.gitignore deleted file mode 100644 index e660fd9..0000000 --- a/hierarchyviewer2/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bin/ diff --git a/hierarchyviewer2/app/.project b/hierarchyviewer2/app/.project deleted file mode 100644 index 9a663d4..0000000 --- a/hierarchyviewer2/app/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>hierarchyviewer</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/hierarchyviewer2/app/.settings/README.txt b/hierarchyviewer2/app/.settings/README.txt deleted file mode 100644 index 9120b20..0000000 --- a/hierarchyviewer2/app/.settings/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -Copy this in eclipse project as a .settings folder at the root. -This ensure proper compilation compliance and warning/error levels.
\ No newline at end of file diff --git a/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs b/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9dbff07..0000000 --- a/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,98 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled -org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hierarchyviewer2/app/Android.mk b/hierarchyviewer2/app/Android.mk deleted file mode 100644 index 6d6b4a2..0000000 --- a/hierarchyviewer2/app/Android.mk +++ /dev/null @@ -1,40 +0,0 @@ -# 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. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_JAVA_RESOURCE_DIRS := src - -LOCAL_JAR_MANIFEST := etc/manifest.txt - -LOCAL_JAVA_LIBRARIES := \ - common \ - ddmlib \ - ddmuilib \ - hierarchyviewerlib \ - swt \ - org.eclipse.jface_3.6.2.M20110210-1200 \ - org.eclipse.core.commands_3.6.0.I20100512-1500 \ - sdklib \ - swtmenubar - -LOCAL_MODULE := hierarchyviewer2 -LOCAL_MODULE_TAGS := debug - -include $(BUILD_HOST_JAVA_LIBRARY) - -# Build all sub-directories -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/hierarchyviewer2/app/NOTICE b/hierarchyviewer2/app/NOTICE deleted file mode 100644 index c5b1efa..0000000 --- a/hierarchyviewer2/app/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2005-2008, 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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/hierarchyviewer2/app/README b/hierarchyviewer2/app/README deleted file mode 100755 index c00ef99..0000000 --- a/hierarchyviewer2/app/README +++ /dev/null @@ -1,69 +0,0 @@ -Using the Eclipse project HierarchyViewer ------------------------------------------ - -HierarchyViewer requires some external libraries to compile. -If you build HierarchyViewer using the makefile, you have nothing -to configure. However if you want to develop on HierarchyViewer -using Eclipse, you need to perform the following configuration. - - -------- -1- Projects required in Eclipse -------- - -To run HierarchyViewer from Eclipse, you need to import the following 5 projects: - - - sdk/hierarchyviewer2/app - - sdk/hierarchyviewer2/libs/hierarchyviewerlib/ - - sdk/ddms/libs/ddmlib - - sdk/ddms/libs/ddmuilib - - sdk/sdkmanager/libs/sdklib - - -------- -2- HierarchyViewer requires some SWT JARs to compile. -------- - -SWT is available in the tree under prebuild/<platform>/swt - -Because the build path cannot contain relative path that are not inside -the project directory, the .classpath file references a user library -called ANDROID_SWT. - -In order to compile the project: -- Open Preferences > Java > Build Path > User Libraries - -- Create a new user library named ANDROID_SWT -- Add the following 4 JAR files: - - - prebuilt/<platform>/swt/swt.jar - - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar - - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar - - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar - - -------- -3- HierarchyViewer also requires the compiled SwtMenuBar library. -------- - -Build the swtmenubar library: -$ cd $TOP (top of Android tree) -$ . build/envsetup.sh && lunch sdk-eng -$ sdk/eclipse/scripts/create_sdkman_symlinks.sh - -Define a classpath variable in Eclipse: -- Open Preferences > Java > Build Path > Classpath Variables -- Create a new classpath variable named ANDROID_OUT_FRAMEWORK -- Set its folder value to <Android tree>/out/host/<platform>/framework -- Create a new classpath variable named ANDROID_SRC -- Set its folder value to <Android tree> - -You might need to clean the ddms project (Project > Clean...) after -you add the new classpath variable, otherwise previous errors might not -go away automatically. - -The ANDROID_SRC part should be optional. It allows you to have access to -the SwtMenuBar generic parts from the Java editor. - --- -EOF diff --git a/hierarchyviewer2/app/etc/Android.mk b/hierarchyviewer2/app/etc/Android.mk deleted file mode 100644 index 07f716c..0000000 --- a/hierarchyviewer2/app/etc/Android.mk +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_PREBUILT_EXECUTABLES := hierarchyviewer -LOCAL_MODULE_TAGS := debug -include $(BUILD_HOST_PREBUILT) diff --git a/hierarchyviewer2/app/etc/hierarchyviewer b/hierarchyviewer2/app/etc/hierarchyviewer deleted file mode 100755 index a0cc5f9..0000000 --- a/hierarchyviewer2/app/etc/hierarchyviewer +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# Copyright 2008, 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. - -# Set up prog to be the path of this script, including following symlinks, -# and set up progdir to be the fully-qualified pathname of its directory. - -prog="$0" -while [ -h "${prog}" ]; do - newProg=`/bin/ls -ld "${prog}"` - newProg=`expr "${newProg}" : ".* -> \(.*\)$"` - if expr "x${newProg}" : 'x/' >/dev/null; then - prog="${newProg}" - else - progdir=`dirname "${prog}"` - prog="${progdir}/${newProg}" - fi -done -oldwd=`pwd` -progdir=`dirname "${prog}"` -cd "${progdir}" -progdir=`pwd` -prog="${progdir}"/`basename "${prog}"` -cd "${oldwd}" - -jarfile=hierarchyviewer2.jar -frameworkdir="$progdir" -libdir="$progdir" -if [ ! -r "$frameworkdir/$jarfile" ] -then - frameworkdir=`dirname "$progdir"`/tools/lib - libdir=`dirname "$progdir"`/tools/lib -fi -if [ ! -r "$frameworkdir/$jarfile" ] -then - frameworkdir=`dirname "$progdir"`/framework - libdir=`dirname "$progdir"`/lib -fi -if [ ! -r "$frameworkdir/$jarfile" ] -then - echo `basename "$prog"`": can't find $jarfile" - exit 1 -fi - - -# Check args. -if [ debug = "$1" ]; then - # add this in for debugging - java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y - shift 1 -else - java_debug= -fi - -javaCmd="java" - -# Mac OS X needs an additional arg, or you get an "illegal thread" complaint. -if [ `uname` = "Darwin" ]; then - os_opts="-XstartOnFirstThread" -else - os_opts= -fi - -if [ `uname` = "Linux" ]; then - export GDK_NATIVE_WINDOWS=true -fi - -jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar" - -# Figure out the path to the swt.jar for the current architecture. -# if ANDROID_SWT is defined, then just use this. -# else, if running in the Android source tree, then look for the correct swt folder in prebuilt -# else, look for the correct swt folder in the SDK under tools/lib/ -swtpath="" -if [ -n "$ANDROID_SWT" ]; then - swtpath="$ANDROID_SWT" -else - vmarch=`${javaCmd} -jar "${frameworkdir}"/archquery.jar` - if [ -n "$ANDROID_BUILD_TOP" ]; then - osname=`uname -s | tr A-Z a-z` - swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt" - else - swtpath="${frameworkdir}/${vmarch}" - fi -fi - -if [ ! -d "$swtpath" ]; then - echo "SWT folder '${swtpath}' does not exist." - echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform." - exit 1 -fi - -if [ -x $progdir/monitor ]; then - echo "The standalone version of hieararchyviewer is deprecated." - echo "Please use Android Device Monitor (tools/monitor) instead." -fi -# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored -# might need more memory, e.g. -Xmx128M -exec "$javaCmd" \ - -Xmx512M $os_opts $java_debug \ - -Dcom.android.hierarchyviewer.bindir="$progdir" \ - -classpath "$jarpath:$swtpath/swt.jar" \ - com.android.hierarchyviewer.HierarchyViewerApplication "$@" diff --git a/hierarchyviewer2/app/etc/hierarchyviewer.bat b/hierarchyviewer2/app/etc/hierarchyviewer.bat deleted file mode 100755 index 432294d..0000000 --- a/hierarchyviewer2/app/etc/hierarchyviewer.bat +++ /dev/null @@ -1,75 +0,0 @@ -@echo off
-rem Copyright (C) 2008 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Get the CWD as a full path with short names only (without spaces)
-for %%i in ("%cd%") do set prog_dir=%%~fsi
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=hierarchyviewer2.jar
-set frameworkdir=
-set libdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=..\framework\
-
-:JarFileOk
-
-if debug NEQ "%1" goto NoDebug
- set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
- shift 1
-:NoDebug
-
-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar;%frameworkdir%swtmenubar.jar
-
-if not defined ANDROID_SWT goto QueryArch
- set swt_path=%ANDROID_SWT%
- goto SwtDone
-
-:QueryArch
-
- for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
-
-:SwtDone
-
-if exist %swt_path% goto SetPath
- echo SWT folder '%swt_path%' does not exist.
- echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
- exit /B
-
-:SetPath
-
-echo The standalone version of hieararchyviewer is deprecated.
-echo Please use Android Device Monitor (tools/monitor.bat) instead.
-call %java_exe% %java_debug% -Xmx512m -Dcom.android.hierarchyviewer.bindir=%prog_dir% -classpath "%jarpath%;%swt_path%\swt.jar" com.android.hierarchyviewer.HierarchyViewerApplication %*
-
-
diff --git a/hierarchyviewer2/app/etc/manifest.txt b/hierarchyviewer2/app/etc/manifest.txt deleted file mode 100644 index 68222bd..0000000 --- a/hierarchyviewer2/app/etc/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Main-Class: com.android.hierarchyviewer.HierarchyViewerApplication -Class-Path: ddmlib.jar ddmuilib.jar hierarchyviewerlib.jar sdklib.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.equinox.common_3.6.0.v20100503.jar guava-tools.jar diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java deleted file mode 100644 index 9968788..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.hierarchyviewer; - -import com.android.ddmuilib.ImageLoader; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -public class AboutDialog extends Dialog { - private Image mAboutImage; - - private Image mSmallImage; - - public AboutDialog(Shell shell) { - super(shell); - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mSmallImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$ - mAboutImage = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$ - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite control = new Composite(parent, SWT.NONE); - control.setLayout(new GridLayout(2, true)); - Composite imageControl = new Composite(control, SWT.BORDER); - imageControl.setLayout(new FillLayout()); - imageControl.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - Label imageLabel = new Label(imageControl, SWT.CENTER); - imageLabel.setImage(mAboutImage); - - CLabel textLabel = new CLabel(control, SWT.NONE); - // TODO: update with new year date (search this to find other occurrences to update) - textLabel.setText("Hierarchy Viewer\nCopyright 2012, The Android Open Source Project\nAll Rights Reserved."); - textLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, true)); - getShell().setText("About..."); - getShell().setImage(mSmallImage); - return control; - - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java deleted file mode 100644 index 8983f67..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java +++ /dev/null @@ -1,942 +0,0 @@ -/* - * 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.hierarchyviewer; - -import com.android.ddmlib.Log; -import com.android.ddmuilib.ImageLoader; -import com.android.hierarchyviewer.actions.AboutAction; -import com.android.hierarchyviewer.actions.LoadAllViewsAction; -import com.android.hierarchyviewer.actions.QuitAction; -import com.android.hierarchyviewer.actions.ShowOverlayAction; -import com.android.hierarchyviewer.util.ActionButton; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; -import com.android.hierarchyviewerlib.actions.CapturePSDAction; -import com.android.hierarchyviewerlib.actions.DisplayViewAction; -import com.android.hierarchyviewerlib.actions.DumpDisplayListAction; -import com.android.hierarchyviewerlib.actions.InspectScreenshotAction; -import com.android.hierarchyviewerlib.actions.InvalidateAction; -import com.android.hierarchyviewerlib.actions.LoadOverlayAction; -import com.android.hierarchyviewerlib.actions.LoadViewHierarchyAction; -import com.android.hierarchyviewerlib.actions.PixelPerfectAutoRefreshAction; -import com.android.hierarchyviewerlib.actions.ProfileNodesAction; -import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectAction; -import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectTreeAction; -import com.android.hierarchyviewerlib.actions.RefreshViewAction; -import com.android.hierarchyviewerlib.actions.RefreshWindowsAction; -import com.android.hierarchyviewerlib.actions.RequestLayoutAction; -import com.android.hierarchyviewerlib.actions.SavePixelPerfectAction; -import com.android.hierarchyviewerlib.actions.SaveTreeViewAction; -import com.android.hierarchyviewerlib.device.IHvDevice; -import com.android.hierarchyviewerlib.models.DeviceSelectionModel; -import com.android.hierarchyviewerlib.models.PixelPerfectModel; -import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener; -import com.android.hierarchyviewerlib.models.TreeViewModel; -import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener; -import com.android.hierarchyviewerlib.ui.DeviceSelector; -import com.android.hierarchyviewerlib.ui.InvokeMethodPrompt; -import com.android.hierarchyviewerlib.ui.LayoutViewer; -import com.android.hierarchyviewerlib.ui.PixelPerfect; -import com.android.hierarchyviewerlib.ui.PixelPerfectControls; -import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe; -import com.android.hierarchyviewerlib.ui.PixelPerfectPixelPanel; -import com.android.hierarchyviewerlib.ui.PixelPerfectTree; -import com.android.hierarchyviewerlib.ui.PropertyViewer; -import com.android.hierarchyviewerlib.ui.TreeView; -import com.android.hierarchyviewerlib.ui.TreeViewControls; -import com.android.hierarchyviewerlib.ui.TreeViewOverview; -import com.android.menubar.IMenuBarEnhancer; -import com.android.menubar.IMenuBarEnhancer.MenuBarMode; -import com.android.menubar.MenuBarEnhancer; - -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.window.ApplicationWindow; -import org.eclipse.swt.SWT; -import org.eclipse.swt.SWTException; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.custom.StackLayout; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.ProgressBar; -import org.eclipse.swt.widgets.Shell; - -public class HierarchyViewerApplication extends ApplicationWindow { - - private static final String APP_NAME = "Hierarchy Viewer"; - private static final int INITIAL_WIDTH = 1280; - private static final int INITIAL_HEIGHT = 800; - - private static HierarchyViewerApplication sMainWindow; - - // Images for moving between the 3 main windows. - private Image mDeviceViewImage; - private Image mPixelPerfectImage; - private Image mTreeViewImage; - private Image mDeviceViewSelectedImage; - private Image mPixelPerfectSelectedImage; - private Image mTreeViewSelectedImage; - - // And their buttons - private Button mTreeViewButton; - private Button mPixelPerfectButton; - private Button mDeviceViewButton; - - private Label mProgressLabel; - private ProgressBar mProgressBar; - private String mProgressString; - - private Composite mDeviceSelectorPanel; - private Composite mTreeViewPanel; - private Composite mPixelPerfectPanel; - private StackLayout mMainWindowStackLayout; - private DeviceSelector mDeviceSelector; - private Composite mStatusBar; - private TreeView mTreeView; - private Composite mMainWindow; - private Image mOnBlackImage; - private Image mOnWhiteImage; - private Button mOnBlackWhiteButton; - private Button mShowExtras; - private LayoutViewer mLayoutViewer; - private PixelPerfectLoupe mPixelPerfectLoupe; - private Composite mTreeViewControls; - private InvokeMethodPrompt mInvokeMethodPrompt; - - private ActionButton dumpDisplayList; - - private HierarchyViewerDirector mDirector; - - /* - * If a thread bails with an uncaught exception, bring the whole - * thing down. - */ - private static class UncaughtHandler implements Thread.UncaughtExceptionHandler { - @Override - public void uncaughtException(Thread t, Throwable e) { - Log.e("HierarchyViewer", "shutting down due to uncaught exception"); - Log.e("HierarchyViewer", e); - System.exit(1); - } - } - - public static final HierarchyViewerApplication getMainWindow() { - return sMainWindow; - } - - public HierarchyViewerApplication() { - super(null /*shell*/); - - sMainWindow = this; - - addMenuBar(); - } - - @Override - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(APP_NAME); - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - Image image = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$ - shell.setImage(image); - } - - @Override - public MenuManager createMenuManager() { - return new MenuManager(); - } - - public void run() { - setBlockOnOpen(true); - - try { - open(); - } catch (SWTException e) { - // Ignore "widget disposed" errors after we closed. - if (!getShell().isDisposed()) { - throw e; - } - } - - TreeViewModel.getModel().removeTreeChangeListener(mTreeChangeListener); - PixelPerfectModel.getModel().removeImageChangeListener(mImageChangeListener); - - ImageLoader.dispose(); - mDirector.stopListenForDevices(); - mDirector.stopDebugBridge(); - mDirector.terminate(); - } - - @Override - protected void initializeBounds() { - Rectangle monitorArea = Display.getDefault().getPrimaryMonitor().getBounds(); - getShell().setSize(Math.min(monitorArea.width, INITIAL_WIDTH), - Math.min(monitorArea.height, INITIAL_HEIGHT)); - getShell().setLocation(monitorArea.x + (monitorArea.width - INITIAL_WIDTH) / 2, - monitorArea.y + (monitorArea.height - INITIAL_HEIGHT) / 2); - } - - private void loadResources() { - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mTreeViewImage = imageLoader.loadImage("tree-view.png", Display.getDefault()); //$NON-NLS-1$ - mTreeViewSelectedImage = - imageLoader.loadImage("tree-view-selected.png", Display.getDefault()); //$NON-NLS-1$ - mPixelPerfectImage = imageLoader.loadImage("pixel-perfect-view.png", Display.getDefault()); //$NON-NLS-1$ - mPixelPerfectSelectedImage = - imageLoader.loadImage("pixel-perfect-view-selected.png", Display.getDefault()); //$NON-NLS-1$ - mDeviceViewImage = imageLoader.loadImage("device-view.png", Display.getDefault()); //$NON-NLS-1$ - mDeviceViewSelectedImage = - imageLoader.loadImage("device-view-selected.png", Display.getDefault()); //$NON-NLS-1$ - mOnBlackImage = imageLoader.loadImage("on-black.png", Display.getDefault()); //$NON-NLS-1$ - mOnWhiteImage = imageLoader.loadImage("on-white.png", Display.getDefault()); //$NON-NLS-1$ - } - - @Override - protected Control createContents(Composite parent) { - // create this only once the window is opened to please SWT on Mac - mDirector = HierarchyViewerApplicationDirector.createDirector(); - mDirector.initDebugBridge(); - mDirector.startListenForDevices(); - mDirector.populateDeviceSelectionModel(); - - TreeViewModel.getModel().addTreeChangeListener(mTreeChangeListener); - PixelPerfectModel.getModel().addImageChangeListener(mImageChangeListener); - - loadResources(); - - Composite control = new Composite(parent, SWT.NONE); - GridLayout mainLayout = new GridLayout(); - mainLayout.marginHeight = mainLayout.marginWidth = 0; - mainLayout.verticalSpacing = mainLayout.horizontalSpacing = 0; - control.setLayout(mainLayout); - mMainWindow = new Composite(control, SWT.NONE); - mMainWindow.setLayoutData(new GridData(GridData.FILL_BOTH)); - mMainWindowStackLayout = new StackLayout(); - mMainWindow.setLayout(mMainWindowStackLayout); - - buildDeviceSelectorPanel(mMainWindow); - buildTreeViewPanel(mMainWindow); - buildPixelPerfectPanel(mMainWindow); - - buildStatusBar(control); - - showDeviceSelector(); - - return control; - } - - - private void buildStatusBar(Composite parent) { - mStatusBar = new Composite(parent, SWT.NONE); - mStatusBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - FormLayout statusBarLayout = new FormLayout(); - statusBarLayout.marginHeight = statusBarLayout.marginWidth = 2; - - mStatusBar.setLayout(statusBarLayout); - - mDeviceViewButton = new Button(mStatusBar, SWT.TOGGLE); - mDeviceViewButton.setImage(mDeviceViewImage); - mDeviceViewButton.setToolTipText("Switch to the window selection view"); - mDeviceViewButton.addSelectionListener(deviceViewButtonSelectionListener); - FormData deviceViewButtonFormData = new FormData(); - deviceViewButtonFormData.left = new FormAttachment(); - mDeviceViewButton.setLayoutData(deviceViewButtonFormData); - - mTreeViewButton = new Button(mStatusBar, SWT.TOGGLE); - mTreeViewButton.setImage(mTreeViewImage); - mTreeViewButton.setEnabled(false); - mTreeViewButton.setToolTipText("Switch to the tree view"); - mTreeViewButton.addSelectionListener(treeViewButtonSelectionListener); - FormData treeViewButtonFormData = new FormData(); - treeViewButtonFormData.left = new FormAttachment(mDeviceViewButton, 2); - mTreeViewButton.setLayoutData(treeViewButtonFormData); - - mPixelPerfectButton = new Button(mStatusBar, SWT.TOGGLE); - mPixelPerfectButton.setImage(mPixelPerfectImage); - mPixelPerfectButton.setEnabled(false); - mPixelPerfectButton.setToolTipText("Switch to the pixel perfect view"); - mPixelPerfectButton.addSelectionListener(pixelPerfectButtonSelectionListener); - FormData pixelPerfectButtonFormData = new FormData(); - pixelPerfectButtonFormData.left = new FormAttachment(mTreeViewButton, 2); - mPixelPerfectButton.setLayoutData(pixelPerfectButtonFormData); - - // Tree View control panel... - mTreeViewControls = new TreeViewControls(mStatusBar); - FormData treeViewControlsFormData = new FormData(); - treeViewControlsFormData.left = new FormAttachment(mPixelPerfectButton, 2); - treeViewControlsFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER); - treeViewControlsFormData.width = 552; - mTreeViewControls.setLayoutData(treeViewControlsFormData); - - // Progress stuff - mProgressLabel = new Label(mStatusBar, SWT.RIGHT); - - mProgressBar = new ProgressBar(mStatusBar, SWT.HORIZONTAL | SWT.INDETERMINATE | SWT.SMOOTH); - FormData progressBarFormData = new FormData(); - progressBarFormData.right = new FormAttachment(100, 0); - progressBarFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER); - mProgressBar.setLayoutData(progressBarFormData); - - FormData progressLabelFormData = new FormData(); - progressLabelFormData.right = new FormAttachment(mProgressBar, -2); - progressLabelFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER); - mProgressLabel.setLayoutData(progressLabelFormData); - - if (mProgressString == null) { - mProgressLabel.setVisible(false); - mProgressBar.setVisible(false); - } else { - mProgressLabel.setText(mProgressString); - } - } - - private void buildDeviceSelectorPanel(Composite parent) { - mDeviceSelectorPanel = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginWidth = gridLayout.marginHeight = 0; - gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0; - mDeviceSelectorPanel.setLayout(gridLayout); - - Composite buttonPanel = new Composite(mDeviceSelectorPanel, SWT.NONE); - buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - GridLayout buttonLayout = new GridLayout(); - buttonLayout.marginWidth = buttonLayout.marginHeight = 0; - buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0; - buttonPanel.setLayout(buttonLayout); - - Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE); - innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - GridLayout innerButtonPanelLayout = new GridLayout(3, true); - innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2; - innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2; - innerButtonPanel.setLayout(innerButtonPanelLayout); - - ActionButton refreshWindows = - new ActionButton(innerButtonPanel, RefreshWindowsAction.getAction()); - refreshWindows.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton loadViewHierarchyButton = - new ActionButton(innerButtonPanel, LoadViewHierarchyAction.getAction()); - loadViewHierarchyButton.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton inspectScreenshotButton = - new ActionButton(innerButtonPanel, InspectScreenshotAction.getAction()); - inspectScreenshotButton.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Composite deviceSelectorContainer = new Composite(mDeviceSelectorPanel, SWT.BORDER); - deviceSelectorContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); - deviceSelectorContainer.setLayout(new FillLayout()); - mDeviceSelector = new DeviceSelector(deviceSelectorContainer, true, true); - } - - public void buildTreeViewPanel(Composite parent) { - mTreeViewPanel = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginWidth = gridLayout.marginHeight = 0; - gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0; - mTreeViewPanel.setLayout(gridLayout); - - Composite buttonPanel = new Composite(mTreeViewPanel, SWT.NONE); - buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - GridLayout buttonLayout = new GridLayout(); - buttonLayout.marginWidth = buttonLayout.marginHeight = 0; - buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0; - buttonPanel.setLayout(buttonLayout); - - Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE); - innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - GridLayout innerButtonPanelLayout = new GridLayout(8, true); - innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2; - innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2; - innerButtonPanel.setLayout(innerButtonPanelLayout); - - ActionButton saveTreeView = - new ActionButton(innerButtonPanel, SaveTreeViewAction.getAction(getShell())); - saveTreeView.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton capturePSD = - new ActionButton(innerButtonPanel, CapturePSDAction.getAction(getShell())); - capturePSD.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton refreshViewAction = - new ActionButton(innerButtonPanel, RefreshViewAction.getAction()); - refreshViewAction.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton displayView = - new ActionButton(innerButtonPanel, DisplayViewAction.getAction(getShell())); - displayView.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton invalidate = new ActionButton(innerButtonPanel, InvalidateAction.getAction()); - invalidate.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton requestLayout = - new ActionButton(innerButtonPanel, RequestLayoutAction.getAction()); - requestLayout.setLayoutData(new GridData(GridData.FILL_BOTH)); - - dumpDisplayList = - new ActionButton(innerButtonPanel, DumpDisplayListAction.getAction()); - dumpDisplayList.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton profileNodes = - new ActionButton(innerButtonPanel, ProfileNodesAction.getAction()); - profileNodes.setLayoutData(new GridData(GridData.FILL_BOTH)); - - SashForm mainSash = new SashForm(mTreeViewPanel, SWT.HORIZONTAL | SWT.SMOOTH); - mainSash.setLayoutData(new GridData(GridData.FILL_BOTH)); - Composite treeViewContainer = new Composite(mainSash, SWT.BORDER); - treeViewContainer.setLayout(new FillLayout()); - mTreeView = new TreeView(treeViewContainer); - - SashForm sideSash = new SashForm(mainSash, SWT.VERTICAL | SWT.SMOOTH); - - mainSash.SASH_WIDTH = 4; - mainSash.setWeights(new int[] { - 7, 3 - }); - - Composite treeViewOverviewContainer = new Composite(sideSash, SWT.BORDER); - treeViewOverviewContainer.setLayout(new FillLayout()); - new TreeViewOverview(treeViewOverviewContainer); - - Composite propertyViewerContainer = new Composite(sideSash, SWT.BORDER); - propertyViewerContainer.setLayout(new GridLayout()); - - PropertyViewer pv = new PropertyViewer(propertyViewerContainer); - pv.setLayoutData(new GridData(GridData.FILL_BOTH)); - - mInvokeMethodPrompt = new InvokeMethodPrompt(propertyViewerContainer); - mInvokeMethodPrompt.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Composite layoutViewerContainer = new Composite(sideSash, SWT.NONE); - GridLayout layoutViewerLayout = new GridLayout(); - layoutViewerLayout.marginWidth = layoutViewerLayout.marginHeight = 0; - layoutViewerLayout.horizontalSpacing = layoutViewerLayout.verticalSpacing = 1; - layoutViewerContainer.setLayout(layoutViewerLayout); - - Composite fullButtonBar = new Composite(layoutViewerContainer, SWT.NONE); - fullButtonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - GridLayout fullButtonBarLayout = new GridLayout(2, false); - fullButtonBarLayout.marginWidth = fullButtonBarLayout.marginHeight = 0; - fullButtonBarLayout.marginRight = 2; - fullButtonBarLayout.horizontalSpacing = fullButtonBarLayout.verticalSpacing = 0; - fullButtonBar.setLayout(fullButtonBarLayout); - - Composite buttonBar = new Composite(fullButtonBar, SWT.NONE); - buttonBar.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL); - rowLayout.marginLeft = - rowLayout.marginRight = rowLayout.marginTop = rowLayout.marginBottom = 0; - rowLayout.pack = true; - rowLayout.center = true; - buttonBar.setLayout(rowLayout); - - mOnBlackWhiteButton = new Button(buttonBar, SWT.PUSH); - mOnBlackWhiteButton.setImage(mOnWhiteImage); - mOnBlackWhiteButton.addSelectionListener(onBlackWhiteSelectionListener); - mOnBlackWhiteButton.setToolTipText("Change layout viewer background color"); - - mShowExtras = new Button(buttonBar, SWT.CHECK); - mShowExtras.setText("Show Extras"); - mShowExtras.addSelectionListener(showExtrasSelectionListener); - mShowExtras.setToolTipText("Show images"); - - ActionButton loadAllViewsButton = - new ActionButton(fullButtonBar, LoadAllViewsAction.getAction()); - loadAllViewsButton.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, true)); - loadAllViewsButton.addSelectionListener(loadAllViewsSelectionListener); - - Composite layoutViewerMainContainer = new Composite(layoutViewerContainer, SWT.BORDER); - layoutViewerMainContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); - layoutViewerMainContainer.setLayout(new FillLayout()); - mLayoutViewer = new LayoutViewer(layoutViewerMainContainer); - - sideSash.SASH_WIDTH = 4; - sideSash.setWeights(new int[] { - 238, 332, 416 - }); - - } - - private void buildPixelPerfectPanel(Composite parent) { - mPixelPerfectPanel = new Composite(parent, SWT.NONE); - GridLayout gridLayout = new GridLayout(); - gridLayout.marginWidth = gridLayout.marginHeight = 0; - gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0; - mPixelPerfectPanel.setLayout(gridLayout); - - Composite buttonPanel = new Composite(mPixelPerfectPanel, SWT.NONE); - buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - GridLayout buttonLayout = new GridLayout(); - buttonLayout.marginWidth = buttonLayout.marginHeight = 0; - buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0; - buttonPanel.setLayout(buttonLayout); - - Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE); - innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - GridLayout innerButtonPanelLayout = new GridLayout(6, true); - innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2; - innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2; - innerButtonPanel.setLayout(innerButtonPanelLayout); - - ActionButton saveTreeView = - new ActionButton(innerButtonPanel, SavePixelPerfectAction.getAction(getShell())); - saveTreeView.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton refreshPixelPerfect = - new ActionButton(innerButtonPanel, RefreshPixelPerfectAction.getAction()); - refreshPixelPerfect.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton refreshPixelPerfectTree = - new ActionButton(innerButtonPanel, RefreshPixelPerfectTreeAction.getAction()); - refreshPixelPerfectTree.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton loadOverlay = - new ActionButton(innerButtonPanel, LoadOverlayAction.getAction(getShell())); - loadOverlay.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton showInLoupe = - new ActionButton(innerButtonPanel, ShowOverlayAction.getAction()); - showInLoupe.setLayoutData(new GridData(GridData.FILL_BOTH)); - - ActionButton autoRefresh = - new ActionButton(innerButtonPanel, PixelPerfectAutoRefreshAction.getAction()); - autoRefresh.setLayoutData(new GridData(GridData.FILL_BOTH)); - - SashForm mainSash = new SashForm(mPixelPerfectPanel, SWT.HORIZONTAL | SWT.SMOOTH); - mainSash.setLayoutData(new GridData(GridData.FILL_BOTH)); - mainSash.SASH_WIDTH = 4; - - Composite pixelPerfectTreeContainer = new Composite(mainSash, SWT.BORDER); - pixelPerfectTreeContainer.setLayout(new FillLayout()); - new PixelPerfectTree(pixelPerfectTreeContainer); - - Composite pixelPerfectLoupeContainer = new Composite(mainSash, SWT.NONE); - GridLayout loupeLayout = new GridLayout(); - loupeLayout.marginWidth = loupeLayout.marginHeight = 0; - loupeLayout.horizontalSpacing = loupeLayout.verticalSpacing = 0; - pixelPerfectLoupeContainer.setLayout(loupeLayout); - - Composite pixelPerfectLoupeBorder = new Composite(pixelPerfectLoupeContainer, SWT.BORDER); - pixelPerfectLoupeBorder.setLayoutData(new GridData(GridData.FILL_BOTH)); - GridLayout pixelPerfectLoupeBorderGridLayout = new GridLayout(); - pixelPerfectLoupeBorderGridLayout.marginWidth = - pixelPerfectLoupeBorderGridLayout.marginHeight = 0; - pixelPerfectLoupeBorderGridLayout.horizontalSpacing = - pixelPerfectLoupeBorderGridLayout.verticalSpacing = 0; - pixelPerfectLoupeBorder.setLayout(pixelPerfectLoupeBorderGridLayout); - - mPixelPerfectLoupe = new PixelPerfectLoupe(pixelPerfectLoupeBorder); - mPixelPerfectLoupe.setLayoutData(new GridData(GridData.FILL_BOTH)); - - PixelPerfectPixelPanel pixelPerfectPixelPanel = - new PixelPerfectPixelPanel(pixelPerfectLoupeBorder); - pixelPerfectPixelPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - PixelPerfectControls pixelPerfectControls = - new PixelPerfectControls(pixelPerfectLoupeContainer); - pixelPerfectControls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - - Composite pixelPerfectContainer = new Composite(mainSash, SWT.BORDER); - pixelPerfectContainer.setLayout(new FillLayout()); - new PixelPerfect(pixelPerfectContainer); - - mainSash.setWeights(new int[] { - 272, 376, 346 - }); - - } - - public void showOverlayInLoupe(boolean value) { - mPixelPerfectLoupe.setShowOverlay(value); - } - - // Shows the progress notification... - public void startTask(final String taskName) { - mProgressString = taskName; - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - if (mProgressLabel != null && mProgressBar != null) { - mProgressLabel.setText(taskName); - mProgressLabel.setVisible(true); - mProgressBar.setVisible(true); - mStatusBar.layout(); - } - } - }); - } - - // And hides it! - public void endTask() { - mProgressString = null; - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - if (mProgressLabel != null && mProgressBar != null) { - mProgressLabel.setVisible(false); - mProgressBar.setVisible(false); - } - } - }); - } - - public void showDeviceSelector() { - // Show the menus. - MenuManager mm = getMenuBarManager(); - mm.removeAll(); - - MenuManager file = new MenuManager("&File"); - IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( - APP_NAME, - getShell().getDisplay(), - file, - AboutAction.getAction(getShell()), - null /*preferencesAction*/, - QuitAction.getAction()); - if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { - mm.add(file); - } - - MenuManager device = new MenuManager("&Devices"); - mm.add(device); - - device.add(RefreshWindowsAction.getAction()); - device.add(LoadViewHierarchyAction.getAction()); - device.add(InspectScreenshotAction.getAction()); - - mm.updateAll(true); - - mDeviceViewButton.setSelection(true); - mDeviceViewButton.setImage(mDeviceViewSelectedImage); - - mTreeViewButton.setSelection(false); - mTreeViewButton.setImage(mTreeViewImage); - - mPixelPerfectButton.setSelection(false); - mPixelPerfectButton.setImage(mPixelPerfectImage); - - mMainWindowStackLayout.topControl = mDeviceSelectorPanel; - - mMainWindow.layout(); - - mDeviceSelector.setFocus(); - - mTreeViewControls.setVisible(false); - } - - public void showTreeView() { - // Show the menus. - MenuManager mm = getMenuBarManager(); - mm.removeAll(); - - MenuManager file = new MenuManager("&File"); - IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( - APP_NAME, - getShell().getDisplay(), - file, - AboutAction.getAction(getShell()), - null /*preferencesAction*/, - QuitAction.getAction()); - if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { - mm.add(file); - } - - MenuManager treeViewMenu = new MenuManager("&Tree View"); - mm.add(treeViewMenu); - - treeViewMenu.add(SaveTreeViewAction.getAction(getShell())); - treeViewMenu.add(CapturePSDAction.getAction(getShell())); - treeViewMenu.add(new Separator()); - treeViewMenu.add(RefreshViewAction.getAction()); - treeViewMenu.add(DisplayViewAction.getAction(getShell())); - - IHvDevice hvDevice = DeviceSelectionModel.getModel().getSelectedDevice(); - if (hvDevice.supportsDisplayListDump()) { - treeViewMenu.add(DumpDisplayListAction.getAction()); - dumpDisplayList.setVisible(true); - } else { - dumpDisplayList.setVisible(false); - } - treeViewMenu.add(new Separator()); - treeViewMenu.add(InvalidateAction.getAction()); - treeViewMenu.add(RequestLayoutAction.getAction()); - - mm.updateAll(true); - - mDeviceViewButton.setSelection(false); - mDeviceViewButton.setImage(mDeviceViewImage); - - mTreeViewButton.setSelection(true); - mTreeViewButton.setImage(mTreeViewSelectedImage); - - mInvokeMethodPrompt.setEnabled(hvDevice.isViewUpdateEnabled()); - - mPixelPerfectButton.setSelection(false); - mPixelPerfectButton.setImage(mPixelPerfectImage); - - mMainWindowStackLayout.topControl = mTreeViewPanel; - - mMainWindow.layout(); - - mTreeView.setFocus(); - - mTreeViewControls.setVisible(true); - } - - public void showPixelPerfect() { - // Show the menus. - MenuManager mm = getMenuBarManager(); - mm.removeAll(); - - MenuManager file = new MenuManager("&File"); - IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager( - APP_NAME, - getShell().getDisplay(), - file, - AboutAction.getAction(getShell()), - null /*preferencesAction*/, - QuitAction.getAction()); - if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) { - mm.add(file); - } - - MenuManager pixelPerfect = new MenuManager("&Pixel Perfect"); - pixelPerfect.add(SavePixelPerfectAction.getAction(getShell())); - pixelPerfect.add(RefreshPixelPerfectAction.getAction()); - pixelPerfect.add(RefreshPixelPerfectTreeAction.getAction()); - pixelPerfect.add(PixelPerfectAutoRefreshAction.getAction()); - pixelPerfect.add(new Separator()); - pixelPerfect.add(LoadOverlayAction.getAction(getShell())); - pixelPerfect.add(ShowOverlayAction.getAction()); - - mm.add(pixelPerfect); - - mm.updateAll(true); - - mDeviceViewButton.setSelection(false); - mDeviceViewButton.setImage(mDeviceViewImage); - - mTreeViewButton.setSelection(false); - mTreeViewButton.setImage(mTreeViewImage); - - mPixelPerfectButton.setSelection(true); - mPixelPerfectButton.setImage(mPixelPerfectSelectedImage); - - mMainWindowStackLayout.topControl = mPixelPerfectPanel; - - mMainWindow.layout(); - - mPixelPerfectLoupe.setFocus(); - - mTreeViewControls.setVisible(false); - } - - private SelectionListener deviceViewButtonSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - mDeviceViewButton.setSelection(true); - showDeviceSelector(); - } - }; - - private SelectionListener treeViewButtonSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - mTreeViewButton.setSelection(true); - showTreeView(); - } - }; - - private SelectionListener pixelPerfectButtonSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - mPixelPerfectButton.setSelection(true); - showPixelPerfect(); - } - }; - - private SelectionListener onBlackWhiteSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - if (mLayoutViewer.getOnBlack()) { - mLayoutViewer.setOnBlack(false); - mOnBlackWhiteButton.setImage(mOnBlackImage); - } else { - mLayoutViewer.setOnBlack(true); - mOnBlackWhiteButton.setImage(mOnWhiteImage); - } - } - }; - - private SelectionListener showExtrasSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - mLayoutViewer.setShowExtras(mShowExtras.getSelection()); - } - }; - - private SelectionListener loadAllViewsSelectionListener = new SelectionListener() { - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - mShowExtras.setSelection(true); - showExtrasSelectionListener.widgetSelected(null); - } - }; - - private ITreeChangeListener mTreeChangeListener = new ITreeChangeListener() { - @Override - public void selectionChanged() { - // pass - } - - @Override - public void treeChanged() { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - if (TreeViewModel.getModel().getTree() == null) { - showDeviceSelector(); - mTreeViewButton.setEnabled(false); - } else { - showTreeView(); - mTreeViewButton.setEnabled(true); - } - } - }); - } - - @Override - public void viewportChanged() { - // pass - } - - @Override - public void zoomChanged() { - // pass - } - }; - - private IImageChangeListener mImageChangeListener = new IImageChangeListener() { - - @Override - public void crosshairMoved() { - // pass - } - - @Override - public void treeChanged() { - // pass - } - - @Override - public void imageChanged() { - // pass - } - - @Override - public void imageLoaded() { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - if (PixelPerfectModel.getModel().getImage() == null) { - mPixelPerfectButton.setEnabled(false); - showDeviceSelector(); - } else { - mPixelPerfectButton.setEnabled(true); - showPixelPerfect(); - } - } - }); - } - - @Override - public void overlayChanged() { - // pass - } - - @Override - public void overlayTransparencyChanged() { - // pass - } - - @Override - public void selectionChanged() { - // pass - } - - @Override - public void zoomChanged() { - // pass - } - - }; - - public static void main(String[] args) { - Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler()); - - Display.setAppName("HierarchyViewer"); - new HierarchyViewerApplication().run(); - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java deleted file mode 100644 index 07fa917..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.hierarchyviewer; - -import com.android.SdkConstants; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; - -import java.io.File; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * This is the application version of the director. - */ -public class HierarchyViewerApplicationDirector extends HierarchyViewerDirector { - - private final ExecutorService mExecutor = Executors.newSingleThreadExecutor(); - - public static HierarchyViewerDirector createDirector() { - return sDirector = new HierarchyViewerApplicationDirector(); - } - - @Override - public void terminate() { - super.terminate(); - mExecutor.shutdown(); - } - - /* - * Gets the location of adb. The script that runs the hierarchy viewer - * defines com.android.hierarchyviewer.bindir. - */ - @Override - public String getAdbLocation() { - String hvParentLocation = System.getProperty("com.android.hierarchyviewer.bindir"); //$NON-NLS-1$ - - // in the new SDK, adb is in the platform-tools, but when run from the command line - // in the Android source tree, then adb is next to hierarchyviewer. - if (hvParentLocation != null && hvParentLocation.length() != 0) { - // check if there's a platform-tools folder - File platformTools = new File(new File(hvParentLocation).getParent(), - SdkConstants.FD_PLATFORM_TOOLS); - if (platformTools.isDirectory()) { - return platformTools.getAbsolutePath() + File.separator + SdkConstants.FN_ADB; - } - - return hvParentLocation + File.separator + SdkConstants.FN_ADB; - } - - return SdkConstants.FN_ADB; - } - - /* - * In the application, we handle background tasks using a single thread, - * just to get rid of possible race conditions that can occur. We update the - * progress bar to show that we are doing something in the background. - */ - @Override - public void executeInBackground(final String taskName, final Runnable task) { - mExecutor.execute(new Runnable() { - @Override - public void run() { - HierarchyViewerApplication.getMainWindow().startTask(taskName); - task.run(); - HierarchyViewerApplication.getMainWindow().endTask(); - } - }); - } - -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java deleted file mode 100644 index 4aff6e0..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.hierarchyviewer.actions; - -import com.android.ddmuilib.ImageLoader; -import com.android.hierarchyviewer.AboutDialog; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; -import com.android.hierarchyviewerlib.actions.ImageAction; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -public class AboutAction extends Action implements ImageAction { - - private static AboutAction sAction; - - private Image mImage; - - private Shell mShell; - - private AboutAction(Shell shell) { - super("&About"); - this.mShell = shell; - setAccelerator(SWT.MOD1 + 'A'); - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$ - setImageDescriptor(ImageDescriptor.createFromImage(mImage)); - setToolTipText("Shows the about dialog"); - } - - public static AboutAction getAction(Shell shell) { - if (sAction == null) { - sAction = new AboutAction(shell); - } - return sAction; - } - - @Override - public void run() { - new AboutDialog(mShell).open(); - } - - @Override - public Image getImage() { - return mImage; - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java deleted file mode 100644 index fd3ce9e..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.hierarchyviewer.actions; - -import com.android.ddmuilib.ImageLoader; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; -import com.android.hierarchyviewerlib.actions.ImageAction; -import com.android.hierarchyviewerlib.actions.TreeViewEnabledAction; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; - -public class LoadAllViewsAction extends TreeViewEnabledAction implements ImageAction { - - private static LoadAllViewsAction sAction; - - private Image mImage; - - private LoadAllViewsAction() { - super("Load All &Views"); - setAccelerator(SWT.MOD1 + 'V'); - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mImage = imageLoader.loadImage("load-all-views.png", Display.getDefault()); //$NON-NLS-1$ - setImageDescriptor(ImageDescriptor.createFromImage(mImage)); - setToolTipText("Load all view images"); - } - - public static LoadAllViewsAction getAction() { - if (sAction == null) { - sAction = new LoadAllViewsAction(); - } - return sAction; - } - - @Override - public void run() { - HierarchyViewerDirector.getDirector().loadAllViews(); - } - - @Override - public Image getImage() { - return mImage; - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java deleted file mode 100644 index b5a8c5f..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.hierarchyviewer.actions; - -import com.android.hierarchyviewer.HierarchyViewerApplication; - -import org.eclipse.jface.action.Action; -import org.eclipse.swt.SWT; - -public class QuitAction extends Action { - - private static QuitAction sAction; - - private QuitAction() { - super("E&xit"); - setAccelerator(SWT.MOD1 + 'Q'); - } - - public static QuitAction getAction() { - if (sAction == null) { - sAction = new QuitAction(); - } - return sAction; - } - - @Override - public void run() { - HierarchyViewerApplication.getMainWindow().close(); - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java deleted file mode 100644 index fb06f36..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.hierarchyviewer.actions; - -import com.android.ddmuilib.ImageLoader; -import com.android.hierarchyviewer.HierarchyViewerApplication; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; -import com.android.hierarchyviewerlib.actions.ImageAction; -import com.android.hierarchyviewerlib.models.PixelPerfectModel; -import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; - -public class ShowOverlayAction extends Action implements ImageAction, IImageChangeListener { - - private static ShowOverlayAction sAction; - - private Image mImage; - - private ShowOverlayAction() { - super("Show In &Loupe", Action.AS_CHECK_BOX); - setAccelerator(SWT.MOD1 + 'L'); - ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class); - mImage = imageLoader.loadImage("show-overlay.png", Display.getDefault()); //$NON-NLS-1$ - setImageDescriptor(ImageDescriptor.createFromImage(mImage)); - setToolTipText("Show the overlay in the loupe view"); - setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null); - PixelPerfectModel.getModel().addImageChangeListener(this); - } - - public static ShowOverlayAction getAction() { - if (sAction == null) { - sAction = new ShowOverlayAction(); - } - return sAction; - } - - @Override - public void run() { - HierarchyViewerApplication.getMainWindow().showOverlayInLoupe(sAction.isChecked()); - } - - @Override - public Image getImage() { - return mImage; - } - - @Override - public void crosshairMoved() { - // pass - } - - @Override - public void treeChanged() { - // pass - } - - @Override - public void imageChanged() { - // pass - } - - @Override - public void imageLoaded() { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - Image overlayImage = PixelPerfectModel.getModel().getOverlayImage(); - setEnabled(overlayImage != null); - } - }); - } - - @Override - public void overlayChanged() { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null); - } - }); - } - - @Override - public void overlayTransparencyChanged() { - // pass - } - - @Override - public void selectionChanged() { - // pass - } - - @Override - public void zoomChanged() { - // pass - } -} diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java deleted file mode 100644 index cd15efc..0000000 --- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.hierarchyviewer.util; - -import com.android.hierarchyviewerlib.actions.ImageAction; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -public class ActionButton implements IPropertyChangeListener, SelectionListener { - private Button mButton; - - private Action mAction; - - public ActionButton(Composite parent, ImageAction action) { - this.mAction = (Action) action; - if (this.mAction.getStyle() == Action.AS_CHECK_BOX) { - mButton = new Button(parent, SWT.CHECK); - } else { - mButton = new Button(parent, SWT.PUSH); - } - mButton.setText(action.getText()); - mButton.setImage(action.getImage()); - this.mAction.addPropertyChangeListener(this); - mButton.addSelectionListener(this); - mButton.setToolTipText(action.getToolTipText()); - mButton.setEnabled(this.mAction.isEnabled()); - } - - @Override - public void propertyChange(PropertyChangeEvent e) { - if (e.getProperty().toUpperCase().equals("ENABLED")) { //$NON-NLS-1$ - mButton.setEnabled((Boolean) e.getNewValue()); - } else if (e.getProperty().toUpperCase().equals("CHECKED")) { //$NON-NLS-1$ - mButton.setSelection(mAction.isChecked()); - } - } - - public void setLayoutData(Object data) { - mButton.setLayoutData(data); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // pass - } - - @Override - public void widgetSelected(SelectionEvent e) { - if (mAction.getStyle() == Action.AS_CHECK_BOX) { - mAction.setChecked(mButton.getSelection()); - } - mAction.run(); - } - - public void addSelectionListener(SelectionListener listener) { - mButton.addSelectionListener(listener); - } - - public void setVisible(boolean visible) { - mButton.setVisible(visible); - } -} |