com.opera.core.systems
Class QuickWidget

java.lang.Object
  extended by com.opera.core.systems.OperaUIElement
      extended by com.opera.core.systems.QuickWidget

public class QuickWidget
extends OperaUIElement

Represents a widget in the Opera desktop UI.

Author:
Adam Minchinton, Karianne Ekern.

Nested Class Summary
static class QuickWidget.DropPosition
           
 
Constructor Summary
QuickWidget(IDesktopUtils desktopUtils, SystemInputManager inputManager, DesktopWmProtos.QuickWidgetInfo info, int parentWindowId)
          Constructor.
 
Method Summary
 void dragAndDropOn(QuickWidget widget, QuickWidget.DropPosition dropPos)
          Drags this widget onto the specified widget at the given drop position
 java.lang.String getAdditionalText()
          Gets additional text of this widget.
 int getColumn()
          Gets the column of the widget within its parent, e.g.
 java.lang.String getName()
           
 java.lang.String getParentName()
          Gets name of parent widget of this widget
 int getParentWindowId()
          Gets window id of this widgets parent window.
 DesktopWmProtos.DesktopWindowRect getRect()
           
 int getRow()
          Gets the row of the widget within its parent, e.g.
 java.lang.String getText()
           
 DesktopWmProtos.QuickWidgetInfo.QuickWidgetType getType()
           
protected  int getValue()
           
 java.lang.String getVisibleText()
          Gets the visible text of the widget.
 boolean hasFocusedLook()
           
 boolean isDefault()
          Checks if widget is default.
 boolean isEnabled()
          Checks if widget is enabled.
 boolean isSelected()
           
 boolean isSelected(java.lang.String stringId)
           
 boolean isVisible()
           
 java.lang.String toFullString()
           
 java.lang.String toString()
           
 
Methods inherited from class com.opera.core.systems.OperaUIElement
click, getCenterLocation, getDesktopUtils, getLocation, getSize, getSystemInputManager, hover, verifyContainsText, verifyText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuickWidget

public QuickWidget(IDesktopUtils desktopUtils,
                   SystemInputManager inputManager,
                   DesktopWmProtos.QuickWidgetInfo info,
                   int parentWindowId)
Constructor.

Parameters:
desktopUtils -
inputManager -
info - QuickWidgetInfo of the widget
parentWindowId - id of parent window
Method Detail

getParentWindowId

public int getParentWindowId()
Gets window id of this widgets parent window.

Returns:
window id of parent window of this QuickWidget

dragAndDropOn

public void dragAndDropOn(QuickWidget widget,
                          QuickWidget.DropPosition dropPos)
Drags this widget onto the specified widget at the given drop position

Parameters:
widget - the widget to drop this widget onto
dropPos - the position to drop this widget into, CENTER, EDGE or BETWEEN

getName

public java.lang.String getName()
Returns:
name of widget

getText

public java.lang.String getText()
Specified by:
getText in class OperaUIElement
Returns:
text of widget

getVisibleText

public java.lang.String getVisibleText()
Gets the visible text of the widget.

Returns:
visible text of widget

getAdditionalText

public java.lang.String getAdditionalText()
Gets additional text of this widget. Used for widgets that have more text attributes, e.g. for highlighted text in the address field

Returns:
text of widget

isDefault

public boolean isDefault()
Checks if widget is default. Typically used to check if e.g. a button is the default pressed button among buttons in a dialog, and such.

Returns:
true if widget is default, else false

hasFocusedLook

public boolean hasFocusedLook()
Returns:
true if this widget has focused look

isEnabled

public boolean isEnabled()
Checks if widget is enabled.

Returns:
true if enabled, else false

isSelected

public boolean isSelected()
Returns:
true if widget is selected, else false

isSelected

public boolean isSelected(java.lang.String stringId)
Parameters:
stringId - stringid of entry to check if is selected
Returns:
true if the entry given by stringId is selected, else false

isVisible

public boolean isVisible()
Overrides:
isVisible in class OperaUIElement
Returns:
true if widget is visible, else false

getType

public DesktopWmProtos.QuickWidgetInfo.QuickWidgetType getType()
Returns:
QuickWidgetType type of this widget. See DesktopWmProtos.QuickWidgetInfo.QuickWidgetType for the possible types

getRect

public DesktopWmProtos.DesktopWindowRect getRect()
Specified by:
getRect in class OperaUIElement
Returns:
DesktopWindowRect of the widget

getRow

public int getRow()
Gets the row of the widget within its parent, e.g. of a treeviewitem in a treeview. Returns 0 for all widgets that don't have a row within its parent

Returns:
row of widget\

getColumn

public int getColumn()
Gets the column of the widget within its parent, e.g. for a tab within the pagebar, or a treeviewitem in a treeview returns 0 for widgets that don't have a column number within its parent

Returns:
column of widget

getValue

protected int getValue()
Returns:
value

getParentName

public java.lang.String getParentName()
Gets name of parent widget of this widget

Returns:
name of parent widget

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toFullString

public java.lang.String toFullString()
Specified by:
toFullString in class OperaUIElement


Copyright © 2011. All Rights Reserved.