public XAccessibleSelection getSelection ()
{ return UnoRuntime.queryInterface(
XAccessibleSelection.class, mxContext);
}
publicvoid addHandler( NodeHandler aHandler )
{ if (aHandler != null)
maHandlers.add (new HandlerDescriptor (aHandler));
}
/** iterate over handlers and return child sum */ private HandlerDescriptor getHandlerDescriptor (int i)
{
HandlerDescriptor aDescriptor = maHandlers.get(i); if (aDescriptor.mnChildCount < 0)
aDescriptor.mnChildCount =
aDescriptor.maHandler.getChildCount (); return aDescriptor;
}
@Override publicint getChildCount()
{ int nChildCount = 0; for (int i = 0; i < maHandlers.size(); i++)
{
HandlerDescriptor aDescriptor = getHandlerDescriptor (i);
nChildCount += aDescriptor.mnChildCount;
} return nChildCount;
}
/** iterate over handlers until the child is found */
@Override public AccessibleTreeNode getChild (int nIndex) throws IndexOutOfBoundsException
{ if( nIndex >= 0 )
{ for(int i = 0; i < maHandlers.size(); i++)
{ // check if this handler has the child, and if not // search with next handler
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); if (nIndex < aDescriptor.mnChildCount) return aDescriptor.maHandler.getChild (this, nIndex); else
nIndex -= aDescriptor.mnChildCount;
}
} else thrownew IndexOutOfBoundsException();
// nothing found? returnnull;
}
@Override public AccessibleTreeNode getChildNoCreate (int nIndex) throws IndexOutOfBoundsException
{ if( nIndex >= 0 )
{ for(int i = 0; i < maHandlers.size(); i++)
{ // check if this handler has the child, and if not // search with next handler
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); if (nIndex < aDescriptor.mnChildCount) return aDescriptor.maHandler.getChildNoCreate (nIndex); else
nIndex -= aDescriptor.mnChildCount;
}
} else thrownew IndexOutOfBoundsException();
// nothing found? returnnull;
}
@Override publicboolean removeChild (int nIndex) throws IndexOutOfBoundsException
{ boolean bStatus = false; if (nIndex >= 0)
{ for (int i=0; i<maHandlers.size(); i++)
{ // check if this handler has the child, and if not // search with next handler
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); if (nIndex < aDescriptor.mnChildCount)
{
bStatus = aDescriptor.maHandler.removeChild (nIndex);
aDescriptor.mnChildCount = aDescriptor.maHandler.getChildCount (); break;
} else
nIndex -= aDescriptor.mnChildCount;
}
} else thrownew IndexOutOfBoundsException();
return bStatus;
}
@Override publicint indexOf (AccessibleTreeNode aNode)
{ int nBaseIndex = 0; if (aNode != null)
{ for (int i=0; i<maHandlers.size(); i++)
{
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); int nIndex = aDescriptor.maHandler.indexOf (aNode); if (nIndex >= 0) return nBaseIndex + nIndex; else
nBaseIndex += aDescriptor.mnChildCount;
}
}
return -1;
}
/** this node is a leaf if have no handlers, or is those
handlers show no children */
@Override publicboolean isLeaf()
{ return maHandlers.isEmpty();
}
/** iterate over handlers until the child is found */ publicvoid getActions(java.util.List<String> aActions)
{ for(int i = 0; i < maHandlers.size(); i++)
{
HandlerDescriptor aDescriptor = getHandlerDescriptor (i);
NodeHandler aHandler = aDescriptor.maHandler;
String[] aHandlerActions = aHandler.getActions (this);
aActions.addAll(Arrays.asList(aHandlerActions));
}
}
@Override publicvoid performAction( int nIndex )
{ if( nIndex >= 0 )
{ for(int i = 0; i < maHandlers.size(); i++)
{ // check if this handler has the child, and if not // search with next handler
HandlerDescriptor aDescriptor = getHandlerDescriptor (i);
NodeHandler aHandler = aDescriptor.maHandler; int nCount = aHandler.getActions(this).length; if( nCount > nIndex )
{
aHandler.performAction(this, nIndex ); return;
} else
nIndex -= nCount;
}
}
}
/** Try to add the specified accessible object as new accessible child of the AccessibleTreeHandler. Notethatchildisusedinanothercontextthan itisusedintheothermethodsofthisclass.
*/ public AccessibleTreeNode addAccessibleChild (XAccessible xChild)
{ for(int i = 0; i < maHandlers.size(); i++)
{
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); if (aDescriptor.maHandler instanceof AccessibleTreeHandler)
{
AccessibleTreeHandler aHandler = (AccessibleTreeHandler)aDescriptor.maHandler;
AccessibleTreeNode aNode = aHandler.addAccessibleChild (this, xChild);
aDescriptor.mnChildCount = aHandler.getChildCount (); return aNode;
}
} returnnull;
}
public java.util.List<Integer> updateChildren (java.lang.Class class1, java.lang.Class<AccessibleExtendedComponentHandler> class2)
{
ArrayList<Integer> aChildIndices = new ArrayList<Integer>(); int nOffset = 0; for(int i=0; i < maHandlers.size(); i++)
{
HandlerDescriptor aDescriptor = getHandlerDescriptor (i); if ((class1.isInstance(aDescriptor.maHandler))
|| (class2 !=null && class2.isInstance(aDescriptor.maHandler)))
{
aDescriptor.maHandler.update(this); // Get updated number of children. int nChildCount = aDescriptor.maHandler.getChildCount ();
aDescriptor.mnChildCount = nChildCount; // Fill in the indices of the updated children. for (int j=0; j<nChildCount; j++)
aChildIndices.add(j+nOffset);
}
nOffset += aDescriptor.mnChildCount;
} return aChildIndices;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.