diff --git a/source/appModules/eclipse.py b/source/appModules/eclipse.py index 66c4880..87825d6 100644 --- a/source/appModules/eclipse.py +++ b/source/appModules/eclipse.py @@ -7,6 +7,10 @@ import controlTypes import appModuleHandler from NVDAObjects.IAccessible import IAccessible +import ui + +COMPLETION_DIALOG_LABEL = u"Press 'Ctrl+Space' to show Template Proposals " +AUTOCOMPLETION_LIST_NAME = u"Autocompletion List" class EclipseTextArea(IAccessible): @@ -17,6 +21,12 @@ class EclipseTextArea(IAccessible): # Therefore, just drop this event. pass +class autocompletionItem(IAccessible): + + def event_selection(self): + # Fixme: I don't know if it is the correct way to do this. + ui.message(self.name) + class AppModule(appModuleHandler.AppModule): def event_NVDAObject_init(self, obj): @@ -24,7 +34,12 @@ class AppModule(appModuleHandler.AppModule): # Eclipse tree views seem to fire a focus event on the previously focused item before firing focus on the new item (EclipseBug:315339). # Try to filter this out. obj.shouldAllowIAccessibleFocusEvent = False + elif obj.role == controlTypes.ROLE_LIST and obj.parent.next.firstChild.name == COMPLETION_DIALOG_LABEL: + # Fixme: Just change the name of the object to allow the detection of children items. + obj.name = AUTOCOMPLETION_LIST_NAME def chooseNVDAObjectOverlayClasses(self, obj, clsList): if obj.windowClassName == "SWT_Window0" and obj.role == controlTypes.ROLE_EDITABLETEXT: clsList.insert(0, EclipseTextArea) + elif obj.role == controlTypes.ROLE_LISTITEM and obj.parent.role == controlTypes.ROLE_LIST and obj.parent.name == AUTOCOMPLETION_LIST_NAME: + clsList.insert(0, autocompletionItem)