1025 |
* selection are overridden, otherwise they are merged |
* selection are overridden, otherwise they are merged |
1026 |
*/ |
*/ |
1027 |
public void setParagraphAttributes(int offset, int length, |
public void setParagraphAttributes(int offset, int length, |
1028 |
AttributeSet attributes, |
AttributeSet attributes, |
1029 |
boolean replace) |
boolean replace) |
1030 |
{ |
{ |
1031 |
// FIXME: Implement me. |
int index = offset; |
1032 |
throw new Error("not implemented"); |
while (index < offset + length) |
1033 |
|
{ |
1034 |
|
AbstractElement par = (AbstractElement) getParagraphElement(index); |
1035 |
|
AttributeContext ctx = getAttributeContext(); |
1036 |
|
if (replace) |
1037 |
|
par.removeAttributes(par); |
1038 |
|
par.addAttributes(attributes); |
1039 |
|
index = par.getElementCount(); |
1040 |
|
} |
1041 |
} |
} |
1042 |
|
|
1043 |
/** |
/** |
1089 |
// joined with the previous element. |
// joined with the previous element. |
1090 |
else if (specs.size() == 0) |
else if (specs.size() == 0) |
1091 |
{ |
{ |
1092 |
if (attr.isEqual(prev.getAttributes())) |
if (prev.getAttributes().isEqual(attr)) |
1093 |
spec.setDirection(ElementSpec.JoinPreviousDirection); |
spec.setDirection(ElementSpec.JoinPreviousDirection); |
1094 |
} |
} |
1095 |
|
|