return (Style) attributes.getResolveParent();
AttributeSet a = attributes.getResolveParent();  if (a instanceof Style) return (Style) a; return null;
  public Style getLogicalStyle(int position)  {    Element paragraph = getParagraphElement(position);    AttributeSet attributes = paragraph.getAttributes();    return (Style) attributes.getResolveParent();  }