Methods Summary |
---|
private void | buildInfo()Rebuilds the information from the current info.
Object lock = lock();
try {
Document doc = getDocument();
Element root = doc.getDefaultRootElement();
rootElementInfo = new ElementInfo(root);
rootElementInfo.validate();
} finally {
unlock(lock);
}
|
javax.swing.text.html.AccessibleHTML$ElementInfo | createElementInfo(javax.swing.text.Element e, javax.swing.text.html.AccessibleHTML$ElementInfo parent)
AttributeSet attrs = e.getAttributes();
if (attrs != null) {
Object name = attrs.getAttribute(StyleConstants.NameAttribute);
if (name == HTML.Tag.IMG) {
return new IconElementInfo(e, parent);
}
else if (name == HTML.Tag.CONTENT || name == HTML.Tag.CAPTION) {
return new TextElementInfo(e, parent);
}
else if (name == HTML.Tag.TABLE) {
return new TableElementInfo(e, parent);
}
}
return null;
|
public javax.accessibility.AccessibleContext | getAccessibleContext()Returns the root AccessibleContext for the document
if (rootHTMLAccessibleContext == null) {
rootHTMLAccessibleContext =
new RootHTMLAccessibleContext(rootElementInfo);
}
return rootHTMLAccessibleContext;
|
private javax.swing.text.Document | getDocument()Returns the Document currently presenting information for.
return model;
|
private java.awt.Rectangle | getRootEditorRect()Returns the bounds the root View will be rendered in.
Rectangle alloc = getTextComponent().getBounds();
if ((alloc.width > 0) && (alloc.height > 0)) {
alloc.x = alloc.y = 0;
Insets insets = editor.getInsets();
alloc.x += insets.left;
alloc.y += insets.top;
alloc.width -= insets.left + insets.right;
alloc.height -= insets.top + insets.bottom;
return alloc;
}
return null;
|
private javax.swing.text.html.AccessibleHTML$ElementInfo | getRootInfo()Returns the ElementInfo representing the root Element.
return rootElementInfo;
|
private javax.swing.text.View | getRootView()Returns the root View associated with the current text
component.
return getTextComponent().getUI().getRootView(getTextComponent());
|
private javax.swing.JEditorPane | getTextComponent()Returns the JEditorPane providing information for.
return editor;
|
private java.lang.Object | lock()If possible acquires a lock on the Document. If a lock has been
obtained a key will be retured that should be passed to
unlock .
Document document = getDocument();
if (document instanceof AbstractDocument) {
((AbstractDocument)document).readLock();
return document;
}
return null;
|
private void | setDocument(javax.swing.text.Document document)Sets the document.
if (model != null) {
model.removeDocumentListener(docListener);
}
if (editor != null) {
editor.removePropertyChangeListener(propChangeListener);
}
this.model = document;
if (model != null) {
if (rootElementInfo != null) {
rootElementInfo.invalidate(false);
}
buildInfo();
model.addDocumentListener(docListener);
}
else {
rootElementInfo = null;
}
if (editor != null) {
editor.addPropertyChangeListener(propChangeListener);
}
|
private void | unlock(java.lang.Object key)Releases a lock previously obtained via lock .
if (key != null) {
((AbstractDocument)key).readUnlock();
}
|