All pastes #364705 Raw Edit

Mine

public text v1 · immutable
#364705 ·published 2007-02-20 10:22 UTC
rendered paste body
table.addListener(SWT.KeyDown,new Listener(){
			public void handleEvent(Event e)
			{
				switch (e.character)
				{
				case SWT.DEL:
					final int[] indices=table.getSelectionIndices();
					
					
					if (indices!=null && indices.length>0)
					{
						final Control[] children=table.getChildren();
						for (int i=indices.length-1;i>=0;i--)
						{
							int index=indices[i];
							children[index].dispose();
						}
						table.remove(indices);
						table.changed(children);
						table.redraw();
					}
					break;
				default:
					break;
				}
			}
		});