패키지 | mx.managers |
클래스 | public class FocusManager |
상속 | FocusManager EventDispatcher Object |
구현 | IFocusManager |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
The FocusManager manages focus from the "component level". In Flex, a UITextField in a component is the only way to allow keyboard entry of text. To the Flash Player or AIR, that UITextField has focus. However, from the FocusManager's perspective the component that parents the UITextField has focus. Thus there is a distinction between component-level focus and player-level focus. Application developers generally only have to deal with component-level focus while component developers must understand player-level focus.
All components that can be managed by the FocusManager must implement mx.managers.IFocusManagerComponent, whereas objects managed by player-level focus do not.
The FocusManager also managers the concept of a defaultButton, which is the Button on a form that dispatches a click event when the Enter key is pressed depending on where focus is at that time.
기타 예제
속성 | 정의 주체 | ||
---|---|---|---|
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
defaultButton : IButton
A reference to the original default Button control. | FocusManager | ||
defaultButtonEnabled : Boolean
A flag that indicates whether the FocusManager should
check for the Enter key being pressed to activate the default button. | FocusManager | ||
focusPane : Sprite
A single Sprite that is moved from container to container
as the focus moves to those containers. | FocusManager | ||
nextTabIndex : int [읽기 전용]
The next unique tab index to use in this tab loop. | FocusManager | ||
showFocusIndicator : Boolean
A flag that indicates whether to display an indicator that
a component has focus. | FocusManager |
메서드 | 정의 주체 | ||
---|---|---|---|
Constructor. | FocusManager | ||
The SystemManager activates and deactivates a FocusManager
if more than one IFocusManagerContainer is visible at the same time. | FocusManager | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
The SystemManager activates and deactivates a FocusManager
if more than one IFocusManagerContainer is visible at the same time. | FocusManager | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
Returns the IFocusManagerComponent that contains the given object, if any. | FocusManager | ||
Gets the IFocusManagerComponent component that currently has the focus. | FocusManager | ||
Returns the IFocusManagerComponent that would receive focus
if the user pressed the Tab key to navigate to another component. | FocusManager | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Sets showFocusIndicator to false
and removes the visual focus indicator from the focused object, if any. | FocusManager | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
Sets focus to an IFocusManagerComponent component. | FocusManager | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
Sets showFocusIndicator to true
and draws the visual focus indicator on the focused object, if any. | FocusManager | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
[재정의]
Returns a String representation of the component hosting the FocusManager object,
with the String ".focusManager" appended to the end of the String. | FocusManager | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
defaultButton | 속성 |
defaultButton:IButton
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
A reference to the original default Button control.
Pressing the Enter key while the focus is on any control
activates the Button control by dispatching a click
event
on the Button control, just as if it was clicked with the mouse.
The actual default Button control changes if focus is given to another
Button control, but switches back to the original if focus is not
on a button.
This property is managed by Flex containers; do not set it directly to specify the default button.
The defaultButton
must be of class
mx.controls.Button
even though this property
is of type IUIComponent
.
구현
public function get defaultButton():IButton
public function set defaultButton(value:IButton):void
defaultButtonEnabled | 속성 |
defaultButtonEnabled:Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
A flag that indicates whether the FocusManager should
check for the Enter key being pressed to activate the default button.
TextArea and other components that want to recognize
the Enter
key
set this property to false
to disable the Enter
key from dispatching a click
event on the
default button, if it exists.
구현
public function get defaultButtonEnabled():Boolean
public function set defaultButtonEnabled(value:Boolean):void
focusPane | 속성 |
focusPane:Sprite
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
A single Sprite that is moved from container to container as the focus moves to those containers. The Sprite is used as the parent of the visual indicator that a component has focus.
구현
public function get focusPane():Sprite
public function set focusPane(value:Sprite):void
nextTabIndex | 속성 |
showFocusIndicator | 속성 |
showFocusIndicator:Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
A flag that indicates whether to display an indicator that
a component has focus.
If true
a component receiving focus
draws a visible indicator that it has focus.
By default, this is false
until the user uses
the Tab key, then it is set to true
.
In general it is better to use
the showFocus()
and hideFocus()
methods
to change this property as those methods also update the
visual indicator that a component has focus.
구현
public function get showFocusIndicator():Boolean
public function set showFocusIndicator(value:Boolean):void
FocusManager | () | 생성자 |
public function FocusManager(container:IFocusManagerContainer, popup:Boolean = false)
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Constructor.
A FocusManager manages the focus within the children of an IFocusManagerContainer. It installs itself in the IFocusManagerContainer during execution of the constructor.
매개 변수container:IFocusManagerContainer — An IFocusManagerContainer that hosts the FocusManager.
| |
popup:Boolean (default = false ) — If true , indicates that the container
is a popup component and not the main application.
|
activate | () | 메서드 |
public function activate():void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
The SystemManager activates and deactivates a FocusManager
if more than one IFocusManagerContainer is visible at the same time.
If the mouse is clicked in an IFocusManagerContainer with a deactivated
FocusManager, the SystemManager will call
the activate()
method on that FocusManager.
The FocusManager that was activated will have its deactivate()
method
called prior to the activation of another FocusManager.
The FocusManager adds event handlers that allow it to monitor focus related keyboard and mouse activity.
deactivate | () | 메서드 |
public function deactivate():void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
The SystemManager activates and deactivates a FocusManager
if more than one IFocusManagerContainer is visible at the same time.
If the mouse is clicked in an IFocusManagerContainer with a deactivated
FocusManager, the SystemManager will call
the activate()
method on that FocusManager.
The FocusManager that was activated will have its deactivate()
method
called prior to the activation of another FocusManager.
The FocusManager removes event handlers that allow it to monitor focus related keyboard and mouse activity.
findFocusManagerComponent | () | 메서드 |
public function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns the IFocusManagerComponent that contains the given object, if any. Because the player can set focus to a subcomponent of a Flex component this method determines which IFocusManagerComponent has focus from the component perspective.
매개 변수
o:InteractiveObject — An object that can have player-level focus.
|
IFocusManagerComponent — The IFOcusManagerComponent containing o or
null
|
getFocus | () | 메서드 |
public function getFocus():IFocusManagerComponent
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Gets the IFocusManagerComponent component that currently has the focus. Calling this method is recommended instead of using the Stage object because it indicates which component has focus. The Stage might return a subcomponent in that component.
반환값IFocusManagerComponent — IFocusManagerComponent object that has focus.
|
getNextFocusManagerComponent | () | 메서드 |
public function getNextFocusManagerComponent(backward:Boolean = false):IFocusManagerComponent
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns the IFocusManagerComponent that would receive focus if the user pressed the Tab key to navigate to another component. It will return the same component as the current focused component if there are no other valid components in the application.
매개 변수
backward:Boolean (default = false ) — If true , return the object
as if the Shift-Tab keys were pressed.
|
IFocusManagerComponent — The component that would receive focus.
|
hideFocus | () | 메서드 |
public function hideFocus():void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Sets showFocusIndicator
to false
and removes the visual focus indicator from the focused object, if any.
setFocus | () | 메서드 |
public function setFocus(o:IFocusManagerComponent):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Sets focus to an IFocusManagerComponent component. Does not check for the components visibility, enabled state, or any other conditions.
매개 변수
o:IFocusManagerComponent — A component that can receive focus.
|
showFocus | () | 메서드 |
public function showFocus():void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Sets showFocusIndicator
to true
and draws the visual focus indicator on the focused object, if any.
toString | () | 메서드 |
override public function toString():String
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns a String representation of the component hosting the FocusManager object,
with the String ".focusManager"
appended to the end of the String.
String — Returns a String representation of the component hosting the FocusManager object,
with the String ".focusManager" appended to the end of the String.
|
Tue Jun 12 2018, 03:17 PM Z