I don't know is this a best way .
simply rebuild text widget.
keep text and selection.
----
public void createPartControl(Composite parent) {
textArea = new Text(parent,SWT.MULTI|SWT.V_SCROLL|SWT.H_SCROLL);
}
public void setWrap(boolean bool){
Composite parent=textArea.getParent();
String text=textArea.getText();
Point pt=textArea.getSelection();
textArea.dispose();
int style=SWT.H_SCROLL;
if(bool){
style=SWT.WRAP;
}
textArea = new Text(parent,SWT.MULTI|SWT.V_SCROLL|style);
textArea.setText(text);
textArea.setSelection(pt);
parent.layout();
about my opensource eclipse java applications recently i'm studying GWT and Android
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment