J
Jan Burse
Dear All
Maybe somebody could help me with the following. I am using
two styles as follows:
private Style output;
private Style input;
SimpleAttributeSet aset = new SimpleAttributeSet();
aset.setResolveParent(input);
replaceRange("Hello", 0, 0, aset);
SimpleAttributeSet aset = new SimpleAttributeSet();
aset.setResolveParent(output);
replaceRange(" World!", 5, 5, aset);
What get is a mixed attributed text, but the attribute was
provided via resolve parent. This works fine, the text comes
out as expected.
Now I am doing a side effect as follows:
StyleConstants.setXXX(input, XXX).
StyleConstants.setXXX(output, XXX).
repaint();
The repaint has no effect. The text is shown the same as before.
But astonishingly when I do the following:
setEditable(false);
setEditable(true);
The resolve parent styles repropagate and the text changes as if
the resolve parents were logical styles on character level. Is
there another more proper way then calling setEditable twice, to
cause this update? Maybe something needs to be done earlier on, such
as registering the styles somewhere?
Any help appreciated.
Best Regards
Maybe somebody could help me with the following. I am using
two styles as follows:
private Style output;
private Style input;
SimpleAttributeSet aset = new SimpleAttributeSet();
aset.setResolveParent(input);
replaceRange("Hello", 0, 0, aset);
SimpleAttributeSet aset = new SimpleAttributeSet();
aset.setResolveParent(output);
replaceRange(" World!", 5, 5, aset);
What get is a mixed attributed text, but the attribute was
provided via resolve parent. This works fine, the text comes
out as expected.
Now I am doing a side effect as follows:
StyleConstants.setXXX(input, XXX).
StyleConstants.setXXX(output, XXX).
repaint();
The repaint has no effect. The text is shown the same as before.
But astonishingly when I do the following:
setEditable(false);
setEditable(true);
The resolve parent styles repropagate and the text changes as if
the resolve parents were logical styles on character level. Is
there another more proper way then calling setEditable twice, to
cause this update? Maybe something needs to be done earlier on, such
as registering the styles somewhere?
Any help appreciated.
Best Regards