You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/04/22 19:20:08 UTC

[royale-asjs] branch develop updated: Core: add IFocusable interface and add it to StyledUIBase

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new e0b2ab3  Core: add IFocusable interface and add it to StyledUIBase
e0b2ab3 is described below

commit e0b2ab3ff7e54edbb5d1377d90a74952ef927dec
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Apr 22 21:20:03 2020 +0200

    Core: add IFocusable interface and add it to StyledUIBase
---
 .../royale/org/apache/royale/core/StyledUIBase.as  |  5 +--
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../royale/org/apache/royale/core/IFocusable.as    | 42 ++++++++++++++++++++++
 3 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
index 5a717da..1cc339a 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/StyledUIBase.as
@@ -23,6 +23,7 @@ package org.apache.royale.core
     import org.apache.royale.core.WrappedHTMLElement;
     import org.apache.royale.html.util.addElementToWrapper;
     }
+    import org.apache.royale.core.IFocusable;
     import org.apache.royale.utils.ClassSelectorList;
     import org.apache.royale.utils.sendEvent;
 
@@ -39,7 +40,7 @@ package org.apache.royale.core
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.3
      */
-    public class StyledUIBase extends UIBase implements IStyledUIBase
+    public class StyledUIBase extends UIBase implements IStyledUIBase, IFocusable
     {
         public static const PRIMARY:String = "primary";
         public static const SECONDARY:String = "secondary";
@@ -500,7 +501,7 @@ package org.apache.royale.core
 
 
         /**
-		 *  perform the set focus on the element
+		 *  Make the component get the focus on the element
 		 *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index caf1467..0910aa3 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -26,6 +26,7 @@ package {
  */
 internal class CoreClasses
 {
+	import org.apache.royale.core.IFocusable; IFocusable;
 	import org.apache.royale.core.IId; IId;
 	import org.apache.royale.core.HTMLElementWrapper; HTMLElementWrapper;
 	import org.apache.royale.core.LayoutBase; LayoutBase;
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IFocusable.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IFocusable.as
new file mode 100644
index 0000000..74fa4bb
--- /dev/null
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IFocusable.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.core
+{
+	/**
+	 *  The IFocusable interface should be implemented by any component
+	 *  that can get the focus
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public interface IFocusable
+	{
+		/**
+		 *  Make the component get the focus on the element
+		 *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        function setFocus(preventScroll:Boolean = false):void;
+	}
+}