com.opera.core.systems.scope.services.ums
Class DesktopWindowManager

java.lang.Object
  extended by com.opera.core.systems.scope.AbstractService
      extended by com.opera.core.systems.scope.services.ums.DesktopWindowManager
All Implemented Interfaces:
IDesktopWindowManager

public class DesktopWindowManager
extends AbstractService
implements IDesktopWindowManager

Author:
Adam Minchinton, Karianne Ekern

Field Summary
 
Fields inherited from class com.opera.core.systems.scope.AbstractService
services
 
Constructor Summary
DesktopWindowManager(IDesktopUtils desktopUtils, SystemInputManager inputManager, ScopeServices services, java.lang.String version)
           
 
Method Summary
 int getActiveQuickWindowId()
          Gets id of active window.
 java.util.List<DesktopWmProtos.DesktopWindowInfo> getDesktopWindowInfoList()
           
 int getOpenQuickWindowCount()
          Gets number of open windows.
 QuickMenu getQuickMenu(java.lang.String menuName)
          Gets the menu with name name.
 QuickMenu getQuickMenu(java.lang.String menuName, int windowId)
           
 QuickMenuItem getQuickMenuItemByAccKey(java.lang.String key, java.lang.String menuName)
          Gets the menu item with the given accelerator key in the menu with name menuName.
 QuickMenuItem getQuickMenuItemByAction(java.lang.String action)
          Gets the menu with the action specified, if any.
 QuickMenuItem getQuickMenuItemByName(java.lang.String name)
           
 QuickMenuItem getQuickMenuItemByName(java.lang.String name, int window_id)
           
 QuickMenuItem getQuickMenuItemByPosition(int row, java.lang.String menuName)
          Gets the menu item with the given position in the menu with name menuName.
 QuickMenuItem getQuickMenuItemByShortcut(java.lang.String shortcut)
          Gets the Menu item with the given shortcut.
 QuickMenuItem getQuickMenuItemBySubmenu(java.lang.String submenu)
          Gets the menu item that opens the sub-menu.
 QuickMenuItem getQuickMenuItemByText(java.lang.String text)
          Gets the menu with the text specified, if any.
 java.util.List<QuickMenuItem> getQuickMenuItemList()
           
 java.util.List<QuickMenu> getQuickMenuList()
           
 QuickWidget getQuickWidget(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type, int windowId, DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property, java.lang.String value)
          Gets a QuickWidget based on a specific property.
 QuickWidget getQuickWidget(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type, int windowId, DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property, java.lang.String value, java.lang.String parentName)
          Gets the quick widget in a specified window based on a specific property and its parent widgets name.
 QuickWidget getQuickWidgetByPos(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type, int id, int row, int column)
          Gets the quick widget based on its position.
 QuickWidget getQuickWidgetByPos(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type, int windowId, int row, int column, java.lang.String parentName)
          Gets the quick widget based on its position and its parent widgets name.
 java.util.List<QuickWidget> getQuickWidgetList(int windowId)
          Gets list of all QuickWidgets in the window.
 QuickWindow getQuickWindow(DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property, java.lang.String value)
          Gets the quick window based on a specific property.
 QuickWindow getQuickWindowById(int windowId)
          Gets the quick window with the given window id.
 QuickWindow getQuickWindowByName(java.lang.String name)
          Gets the window with name name.
 int getQuickWindowID(java.lang.String name)
          Gets window id of window with the given name.
 java.util.List<QuickWindow> getQuickWindowList()
          Gets a list of all open windows.
 java.lang.String getQuickWindowName(int windowId)
          Gets the name of the window with windowId.
 void init()
          Does initialization necessary to set up the service.
 void pressQuickMenuItem(java.lang.String menuItemText, boolean popMenu)
           
 
Methods inherited from class com.opera.core.systems.scope.AbstractService
buildPayload, executeCommand, executeCommand, getVersion, isVersionInRange, sleep, xpathIterator, xpathPointer, xpathQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesktopWindowManager

public DesktopWindowManager(IDesktopUtils desktopUtils,
                            SystemInputManager inputManager,
                            ScopeServices services,
                            java.lang.String version)
Method Detail

init

public void init()
Description copied from interface: IDesktopWindowManager
Does initialization necessary to set up the service.

Specified by:
init in interface IDesktopWindowManager

getActiveQuickWindowId

public int getActiveQuickWindowId()
Description copied from interface: IDesktopWindowManager
Gets id of active window.

Specified by:
getActiveQuickWindowId in interface IDesktopWindowManager
Returns:
id of active window

getOpenQuickWindowCount

public int getOpenQuickWindowCount()
Description copied from interface: IDesktopWindowManager
Gets number of open windows.

Specified by:
getOpenQuickWindowCount in interface IDesktopWindowManager
Returns:
number of open windows

getQuickWindow

public QuickWindow getQuickWindow(DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property,
                                  java.lang.String value)
Description copied from interface: IDesktopWindowManager
Gets the quick window based on a specific property.

Specified by:
getQuickWindow in interface IDesktopWindowManager
Parameters:
property - - property to search by
value - - value of property given
Returns:
QuickWindow matching the parameters, or null if no such widget

getQuickWindowList

public java.util.List<QuickWindow> getQuickWindowList()
Description copied from interface: IDesktopWindowManager
Gets a list of all open windows.

Specified by:
getQuickWindowList in interface IDesktopWindowManager
Returns:
list of all open windows

getDesktopWindowInfoList

public java.util.List<DesktopWmProtos.DesktopWindowInfo> getDesktopWindowInfoList()

getQuickWindowID

public int getQuickWindowID(java.lang.String name)
Description copied from interface: IDesktopWindowManager
Gets window id of window with the given name.

Specified by:
getQuickWindowID in interface IDesktopWindowManager
Parameters:
name - window name
Returns:
id of window with the given name

getQuickWindowByName

public QuickWindow getQuickWindowByName(java.lang.String name)
Description copied from interface: IDesktopWindowManager
Gets the window with name name.

Specified by:
getQuickWindowByName in interface IDesktopWindowManager
Parameters:
name - window name
Returns:
QuickWindow

getQuickWindowById

public QuickWindow getQuickWindowById(int windowId)
Description copied from interface: IDesktopWindowManager
Gets the quick window with the given window id.

Specified by:
getQuickWindowById in interface IDesktopWindowManager
Parameters:
windowId - id of the window
Returns:
QuickWindow with id windowId, if any, else null.

getQuickWindowName

public java.lang.String getQuickWindowName(int windowId)
Description copied from interface: IDesktopWindowManager
Gets the name of the window with windowId.

Specified by:
getQuickWindowName in interface IDesktopWindowManager
Parameters:
windowId - id of window
Returns:
name of the window

getQuickWidget

public QuickWidget getQuickWidget(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type,
                                  int windowId,
                                  DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property,
                                  java.lang.String value)
Description copied from interface: IDesktopWindowManager
Gets a QuickWidget based on a specific property.

Specified by:
getQuickWidget in interface IDesktopWindowManager
Parameters:
type - what type
windowId - window id of the window containing the widget
property - property specified for the search
value - value of property given
Returns:
QuickWidget matching the property, or null if no such widget

getQuickWidget

public QuickWidget getQuickWidget(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type,
                                  int windowId,
                                  DesktopWmProtos.QuickWidgetSearch.QuickWidgetSearchType property,
                                  java.lang.String value,
                                  java.lang.String parentName)
Description copied from interface: IDesktopWindowManager
Gets the quick widget in a specified window based on a specific property and its parent widgets name.

Specified by:
getQuickWidget in interface IDesktopWindowManager
Parameters:
type - what type
windowId - window id of the window containing the widget
property - property specified for the search
value - value of property given
parentName - Name of the widgets parent widget
Returns:
QuickWidget matching the property, or null if no such widget

getQuickWidgetByPos

public QuickWidget getQuickWidgetByPos(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type,
                                       int id,
                                       int row,
                                       int column)
Description copied from interface: IDesktopWindowManager
Gets the quick widget based on its position.

Specified by:
getQuickWidgetByPos in interface IDesktopWindowManager
Parameters:
type - what type
id - window id of the window containing the widget
row - row of the widget
column - column of the widget
Returns:
QuickWidget matching the parameters, or null if no such widget

getQuickWidgetByPos

public QuickWidget getQuickWidgetByPos(DesktopWmProtos.QuickWidgetInfo.QuickWidgetType type,
                                       int windowId,
                                       int row,
                                       int column,
                                       java.lang.String parentName)
Description copied from interface: IDesktopWindowManager
Gets the quick widget based on its position and its parent widgets name.

Specified by:
getQuickWidgetByPos in interface IDesktopWindowManager
Parameters:
type - what type
windowId - window id of the window containing the widget
row - row of the widget
column - column of the widget
parentName - Name of the widgets parent widget
Returns:
QuickWidget matching the parameters, or null if no such widget

getQuickWidgetList

public java.util.List<QuickWidget> getQuickWidgetList(int windowId)
Description copied from interface: IDesktopWindowManager
Gets list of all QuickWidgets in the window.

Specified by:
getQuickWidgetList in interface IDesktopWindowManager
Parameters:
windowId - id of window
Returns:
list of QuickWidgets in the window given by id id

getQuickMenu

public QuickMenu getQuickMenu(java.lang.String menuName)
Description copied from interface: IDesktopWindowManager
Gets the menu with name name.

Specified by:
getQuickMenu in interface IDesktopWindowManager
Parameters:
menuName - the menu's name
Returns:
QuickMenu

getQuickMenuList

public java.util.List<QuickMenu> getQuickMenuList()
Specified by:
getQuickMenuList in interface IDesktopWindowManager
Returns:
list of all menus that are open (including menu bar(s))

getQuickMenuItemList

public java.util.List<QuickMenuItem> getQuickMenuItemList()
Specified by:
getQuickMenuItemList in interface IDesktopWindowManager
Returns:
list containing all menu items in open menus (including menu bar(s))

pressQuickMenuItem

public void pressQuickMenuItem(java.lang.String menuItemText,
                               boolean popMenu)
Specified by:
pressQuickMenuItem in interface IDesktopWindowManager

getQuickMenuItemByAction

public QuickMenuItem getQuickMenuItemByAction(java.lang.String action)
Description copied from interface: IDesktopWindowManager
Gets the menu with the action specified, if any.

Specified by:
getQuickMenuItemByAction in interface IDesktopWindowManager
Parameters:
action - of the menu item to search for
Returns:
QuickMenuItem with action, or null if the item doesn't exist

getQuickMenuItemBySubmenu

public QuickMenuItem getQuickMenuItemBySubmenu(java.lang.String submenu)
Description copied from interface: IDesktopWindowManager
Gets the menu item that opens the sub-menu.

Specified by:
getQuickMenuItemBySubmenu in interface IDesktopWindowManager
Parameters:
submenu - the name of the sub-menu the menu item opens when its selected/clicked
Returns:
QuickMenuItem or null if the item doesn't exist

getQuickMenuItemByText

public QuickMenuItem getQuickMenuItemByText(java.lang.String text)
Description copied from interface: IDesktopWindowManager
Gets the menu with the text specified, if any.

Specified by:
getQuickMenuItemByText in interface IDesktopWindowManager
Parameters:
text - of the menu item to search for
Returns:
QuickMenuItem with the given text, or null if no such item exists

getQuickMenuItemByAccKey

public QuickMenuItem getQuickMenuItemByAccKey(java.lang.String key,
                                              java.lang.String menuName)
Description copied from interface: IDesktopWindowManager
Gets the menu item with the given accelerator key in the menu with name menuName.

Specified by:
getQuickMenuItemByAccKey in interface IDesktopWindowManager
Parameters:
key - the shortcut key of the menu item to search for (the character that's underlined/marked in the menu item text)
menuName - name of the menu of the menu item
Returns:
QuickMenuItem or null if the item doesn't exist

getQuickMenuItemByShortcut

public QuickMenuItem getQuickMenuItemByShortcut(java.lang.String shortcut)
Description copied from interface: IDesktopWindowManager
Gets the Menu item with the given shortcut.

Specified by:
getQuickMenuItemByShortcut in interface IDesktopWindowManager
Parameters:
shortcut - string representation of the shortcut of the menuitem (i.e. "Ctrl+O")
Returns:
QuickMenuItem, or null if the item doesnt exist

getQuickMenuItemByPosition

public QuickMenuItem getQuickMenuItemByPosition(int row,
                                                java.lang.String menuName)
Description copied from interface: IDesktopWindowManager
Gets the menu item with the given position in the menu with name menuName.

Specified by:
getQuickMenuItemByPosition in interface IDesktopWindowManager
Parameters:
row - the row of the item, counting from zero, and including both normal items and menu separators
menuName - name of the menu to lookup the menu item in
Returns:
QuickMenuItem, or null if the item doesn't exist

getQuickMenuItemByName

public QuickMenuItem getQuickMenuItemByName(java.lang.String name)
Specified by:
getQuickMenuItemByName in interface IDesktopWindowManager
Parameters:
name - name of the item. This is either the name of the action the item executes when selected The name of the sub-menu the item opens when selected "Separator" for items that are separators
Returns:
the menu item

getQuickMenu

public QuickMenu getQuickMenu(java.lang.String menuName,
                              int windowId)
Specified by:
getQuickMenu in interface IDesktopWindowManager
Parameters:
menuName - name of the menu (as specified in standard_menu.ini)
windowId - id of the window the menu is attached to (note: only makes sense for menu bar)
Returns:
QuickMenu with name menuName in windowId if it exists, else null

getQuickMenuItemByName

public QuickMenuItem getQuickMenuItemByName(java.lang.String name,
                                            int window_id)
Specified by:
getQuickMenuItemByName in interface IDesktopWindowManager
Parameters:
name - Name of the menuItem
window_id - windowId of the window the menu of the item is in (note: only makes sense for menu bar items)
Returns:
the menu item


Copyright © 2011. All Rights Reserved.