void createTableDelegate() { if (tableDelegate == null) { tableDelegate = new TableAccessibleDelegate(this); } }
public void getColumnHeader(AccessibleTableEvent e) { e.accessible = (childColumnToIdMap.size() > 1 ? headerAccessible() : null); } public void getRowCount(AccessibleTableEvent e) {
void reset() { release(); childColumnToIdMap = new HashMap(); childRowToIdMap = new HashMap(); } }
case ACC.EVENT_TABLE_CHANGED: if (tableDelegate != null) { tableDelegate.reset(); getRowsAttribute(ACC.CHILDID_SELF); getColumnsAttribute(ACC.CHILDID_SELF);
public void getColumns(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); getColumnCount(event); // This happens if the table listeners just report back a column count but don't have // distinct objects for each of the column. // When that happens we need to make 'fake' accessibles that represent the rows. if (event.count != childColumnToIdMap.size()) { childColumnToIdMap.clear(); } Accessible[] columns = new Accessible[event.count]; for (int i = 0; i < event.count; i++) { columns[i] = childColumnToOs(i); } int columnCount = childColumnToIdMap.size() > 0 ? childColumnToIdMap.size() : 1; Accessible[] accessibles = new Accessible[columnCount]; for (int i = 0; i < columnCount; i++) { accessibles[i] = (Accessible) childColumnToIdMap.get(new Integer(i)); } e.accessibles = accessibles; } public void getColumnHeader(AccessibleTableEvent e) {
public void getRows(AccessibleTableEvent e) { AccessibleTableEvent event = new AccessibleTableEvent(this); getRowCount(event); // This happens if the table listeners just report back a column count but don't have // distinct objects for each of the column. // When that happens we need to make 'fake' accessibles that represent the rows. if (event.count != childRowToIdMap.size()) { childRowToIdMap.clear(); } Accessible[] rows = new Accessible[event.count]; for (int i = 0; i < event.count; i++) { rows[i] = childRowToOs(i); } int columnCount = childRowToIdMap.size() > 0 ? childRowToIdMap.size() : 1; Accessible[] accessibles = new Accessible[columnCount]; for (int i = 0; i < columnCount; i++) { accessibles[i] = (Accessible) childRowToIdMap.get(new Integer(i)); } e.accessibles = accessibles; } });
void release(boolean destroy) { if (actionNames != null) actionNames.release(); actionNames = null; if (attributeNames != null) attributeNames.release(); attributeNames = null; if (parameterizedAttributeNames != null) parameterizedAttributeNames.release(); parameterizedAttributeNames = null; if (delegate != null) { delegate.internal_dispose_SWTAccessibleDelegate(); delegate.release(); } delegate = null; relations = null; if (childToIdMap != null) { Collection delegates = childToIdMap.values(); Iterator iter = delegates.iterator(); while (iter.hasNext()) { SWTAccessibleDelegate childDelegate = (SWTAccessibleDelegate)iter.next(); childDelegate.internal_dispose_SWTAccessibleDelegate(); childDelegate.release(); } childToIdMap.clear(); childToIdMap = null; } if (tableDelegate != null) tableDelegate.release(); }
public void getChildren(AccessibleControlEvent e) { int childCount = childColumnToIdMap.size() + childRowToIdMap.size(); if (childColumnToIdMap.size() > 1) childCount++; Accessible[] children = new Accessible[childCount]; int childIndex = 0; Iterator iter = childRowToIdMap.values().iterator(); while (iter.hasNext()) { AccessibleTableRow row = (AccessibleTableRow)iter.next(); children[childIndex++] = row; } iter = childColumnToIdMap.values().iterator(); while (iter.hasNext()) { AccessibleTableColumn col = (AccessibleTableColumn)iter.next(); children[childIndex++] = col; } if (childColumnToIdMap.size() > 1) children[childIndex] = headerAccessible(); e.children = children; }