Esempio n. 1
0
  private void removeOwnerShellListener() {

    final Shell ownerShell = _ownerControl.getShell();

    ownerShell.removeListener(SWT.Deactivate, _ownerShellListener);
    ownerShell.removeListener(SWT.Move, _ownerShellListener);
  }
Esempio n. 2
0
  public void clearMap(boolean performRedraw) {
    Listener[] painters;

    painters = mapShell.getListeners(SWT.Paint);

    for (int i = 0; i < painters.length; i++) mapShell.removeListener(SWT.Paint, painters[i]);

    if (performRedraw) mapShell.redraw();
  }
Esempio n. 3
0
  /* (non-Javadoc)
   * @see javax.microedition.lcdui.Displayable#handleHideEvent()
   */
  void eswtHandleHideCurrentEvent() {
    super.eswtHandleHideCurrentEvent();
    topShell.removeListener(SWT.Resize, resizeListener);

    nextDisplayable = null;
    resetTimerTask(false);

    // remove key filter for scrollable text composite
    org.eclipse.swt.widgets.Display.getCurrent().removeFilter(SWT.KeyDown, keyListener);
    org.eclipse.swt.widgets.Display.getCurrent().removeFilter(SWT.Traverse, keyListener);
    org.eclipse.swt.widgets.Display.getCurrent().removeFilter(SWT.MouseUp, keyListener);
  }
Esempio n. 4
0
 void handleFocus(int type) {
   if (isDisposed()) return;
   switch (type) {
     case SWT.FocusIn:
       {
         if (hasFocus) return;
         if (getEditable()) text.selectAll();
         hasFocus = true;
         Shell shell = getShell();
         shell.removeListener(SWT.Deactivate, listener);
         shell.addListener(SWT.Deactivate, listener);
         Display display = getDisplay();
         display.removeFilter(SWT.FocusIn, filter);
         display.addFilter(SWT.FocusIn, filter);
         Event e = new Event();
         notifyListeners(SWT.FocusIn, e);
         break;
       }
     case SWT.FocusOut:
       {
         if (!hasFocus) return;
         Control focusControl = getDisplay().getFocusControl();
         if (focusControl == arrow
             || focusControl == list
             || focusControl == icon
             || focusControl == text) return;
         hasFocus = false;
         Shell shell = getShell();
         shell.removeListener(SWT.Deactivate, listener);
         Display display = getDisplay();
         display.removeFilter(SWT.FocusIn, filter);
         Event e = new Event();
         notifyListeners(SWT.FocusOut, e);
         dropDown(false);
         break;
       }
   }
 }
Esempio n. 5
0
    // Remove installed listeners
    void removeListeners() {
      if (isValid()) {
        proposalTable.removeListener(SWT.FocusOut, this);
        ScrollBar scrollbar = proposalTable.getVerticalBar();
        if (scrollbar != null) {
          scrollbar.removeListener(SWT.Selection, this);
        }

        getShell().removeListener(SWT.Deactivate, this);
        getShell().removeListener(SWT.Close, this);
      }

      if (control != null && !control.isDisposed()) {

        control.removeListener(SWT.MouseDoubleClick, this);
        control.removeListener(SWT.MouseDown, this);
        control.removeListener(SWT.Dispose, this);
        control.removeListener(SWT.FocusOut, this);

        Shell controlShell = control.getShell();
        controlShell.removeListener(SWT.Move, this);
        controlShell.removeListener(SWT.Resize, this);
      }
    }
Esempio n. 6
0
 void comboEvent(Event event) {
   switch (event.type) {
     case SWT.Dispose:
       if (popup != null && !popup.isDisposed()) {
         list.removeListener(SWT.Dispose, listener);
         popup.dispose();
       }
       Shell shell = getShell();
       shell.removeListener(SWT.Deactivate, listener);
       Display display = getDisplay();
       display.removeFilter(SWT.FocusIn, filter);
       popup = null;
       text = null;
       list = null;
       arrow = null;
       break;
     case SWT.Move:
       dropDown(false);
       break;
     case SWT.Resize:
       internalLayout(false);
       break;
   }
 }