You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/24 23:40:14 UTC
[2/2] git commit: [flex-asjs] [refs/heads/develop] - DOMPathUtil was
in a package called 'debug' which was somehow ignored by git. I don't see it
in .gitignore, but I changed the package name so it would be visible
DOMPathUtil was in a package called 'debug' which was somehow ignored by git. I don't see it in .gitignore, but I changed the package name so it would be visible
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/65248146
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/65248146
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/65248146
Branch: refs/heads/develop
Commit: 6524814664121d04025f41906b1ad973997fc0ed
Parents: 3f1e687
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 24 14:40:04 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 24 14:40:04 2014 -0700
----------------------------------------------------------------------
.../html/beads/layouts/NonVirtualBasicLayout.as | 2 +-
.../beads/layouts/NonVirtualHorizontalLayout.as | 2 +-
.../beads/layouts/NonVirtualVerticalLayout.as | 2 +-
.../org/apache/flex/utils/dbg/DOMPathUtil.as | 94 ++++++++++++++++++++
4 files changed, 97 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
index b83b2ff..6a19204 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualBasicLayout.as
@@ -28,7 +28,7 @@ package org.apache.flex.html.beads.layouts
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.debug.DOMPathUtil;
+ import org.apache.flex.utils.dbg.DOMPathUtil;
/**
* The NonVirtualBasicLayout class is a simple layout
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
index 820c410..c663d8f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualHorizontalLayout.as
@@ -27,7 +27,7 @@ package org.apache.flex.html.beads.layouts
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.debug.DOMPathUtil;
+ import org.apache.flex.utils.dbg.DOMPathUtil;
/**
* The NonVirtualHorizontalLayout class is a simple layout
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
index cf0de6a..5b7e5d6 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/layouts/NonVirtualVerticalLayout.as
@@ -28,7 +28,7 @@ package org.apache.flex.html.beads.layouts
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.debug.DOMPathUtil;
+ import org.apache.flex.utils.dbg.DOMPathUtil;
/**
* The NonVirtualVerticalLayout class is a simple layout
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65248146/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
new file mode 100644
index 0000000..8e783ac
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/dbg/DOMPathUtil.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You 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 org.apache.flex.utils.dbg
+{
+ import flash.utils.Dictionary;
+ import flash.utils.getQualifiedClassName;
+
+ import org.apache.flex.core.IChild;
+
+ /**
+ * The DOMPathUtil class is a tracks instances of display objects
+ * and provides a unique string for each one based on its position
+ * in the tree of display objects. It is generally used for
+ * trace output. If you think you need this for production applications
+ * you might want to re-think your design.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DOMPathUtil
+ {
+ /**
+ * @private
+ */
+ public function DOMPathUtil()
+ {
+ throw new Error("DOMPathUtil should not be instantiated.");
+ }
+
+ private static var dict:Dictionary = new Dictionary(true);
+ private static var counter:int = 0;
+
+ /**
+ * Returns a string for an object. IF the object is parented, it
+ * creates a string based on the DOMPathUtil of the parent.
+ *
+ * @param obj The object to generate a path/name for.
+ * @return The unique name based on the parents.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function getPath(obj:Object):String
+ {
+ if (obj == null) return "";
+
+ var name:String = null;
+ if (dict[obj] == null)
+ {
+ try {
+ name = obj.id;
+ } catch (e:Error)
+ {
+ }
+ if (name == null)
+ {
+ name = getQualifiedClassName(obj);
+ var c:int = name.lastIndexOf(":");
+ if (c != -1)
+ name = name.substr(c + 1);
+ name += (counter++).toString();
+ }
+ dict[obj] = name;
+ }
+ name = dict[obj];
+
+ if (obj is IChild)
+ {
+ name = getPath(IChild(obj).parent) + "/" + name;
+ }
+ return name;
+ }
+ }
+}
\ No newline at end of file