Unable to paste MS-Excel column into SWT’s Text widget?

The problem is with new line character which Excel put after each cell in selected column Text. SINGLE then recognize end of the line in pasted text and trim it.

The problem is with new line character which Excel put after each cell in selected column. Text. SINGLE then recognize end of the line in pasted text and trim it.

This code get the paste event and replace all new line character for selected one import org.eclipse.swt. SWT; import org.eclipse.swt.layout. RowLayout; import org.eclipse.swt.widgets.

Display; import org.eclipse.swt.widgets. Event; import org.eclipse.swt.widgets. Listener; import org.eclipse.swt.widgets.

Shell; import org.eclipse.swt.widgets. Text; public class PasteModify { private final String lineReplaceString = ", "; public static void main(String args) { Display display = new Display(); Shell shell = new Shell(display); shell. SetLayout(new RowLayout(SWT.

VERTICAL)); Text tfPaste = new Text(shell, SWT. BORDER); tfPaste. SetText("paste excel column here"); tfPaste.

AddListener(SWT. Verify, new Listener() { @Override public void handleEvent(Event event) { event. Text = event.text.

Replace("\n", PasteModify.this. LineReplaceString); } }); shell. SetBounds(50, 50, 300, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions