コード例 #1
0
 private void replaceListener(
     Widget provider, TypedListener oldListener, SelectionListener newListener) {
   provider.removeListener(SWT.Selection, oldListener);
   provider.removeListener(SWT.DefaultSelection, oldListener);
   provider.addListener(SWT.Selection, new TypedListener(newListener));
   provider.addListener(SWT.DefaultSelection, new TypedListener(newListener));
 }
コード例 #2
0
 private void handleWidgetDispose(Event event) {
   if (event.widget == widget) {
     widget.removeListener(SWT.Selection, getItemListener());
     widget.removeListener(SWT.Dispose, getItemListener());
     widget = null;
     disposeOldImages();
   }
 }
コード例 #3
0
 private void replaceMenuListener(
     Widget provider, TypedListener oldListener, MenuListener newListener) {
   provider.removeListener(SWT.Show, oldListener);
   provider.addListener(SWT.Show, new TypedListener(newListener));
 }