Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Shell.addListener()


        control.addListener(SWT.Dispose, this);
        control.addListener(SWT.FocusOut, this);
        // Listeners on the target control's shell
        Shell controlShell = control.getShell();
        controlShell.addListener(SWT.Move, this);
        controlShell.addListener(SWT.Resize, this);

      }

      // Remove installed listeners
      void removeListeners() {
View Full Code Here


        shell.setLayout(new GridLayout());      
        int x = display.getBounds().width;
        int y = display.getBounds().height;
        shell.setBounds(x/4, y/4, width, height);
       
        shell.addListener(SWT.Traverse, new Listener () {
            public void handleEvent (Event event) {
                switch (event.detail) {
                    case SWT.TRAVERSE_ESCAPE:
                        shell.close ();
                        event.detail = SWT.TRAVERSE_NONE;
View Full Code Here

    {
        final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
        shell.setText(title);
        shell.setLayout(new GridLayout());      
       
        shell.addListener(SWT.Traverse, new Listener () {
            public void handleEvent (Event event) {
                switch (event.detail) {
                    case SWT.TRAVERSE_ESCAPE:
                        shell.close ();
                        event.detail = SWT.TRAVERSE_NONE;
View Full Code Here

      /*
       * In order to enable the users to close the description by just
       * pressing the ESC key.
       */
      descriptionShell.addListener(SWT.Traverse,
                     new DescriptionShellListener(descriptionButton));
      return descriptionShell;
    }
  }
 
View Full Code Here

           
            if (DELAY_MOUSE_DOWN_SWT_POPUP_TRIGGERS) {
                // Install a listener that waits until the popup parent receives
                // a MouseEnter event before displaying the menu. If we don't wait
                // for this event, the menu is not displayed.
                popupParent.addListener(SWT.MouseEnter, new Listener() {
                    public void handleEvent(Event e) {
                        if (CREATE_POPUP_PARENT_SHELL) {
                            // Install a listener to hide the (created) popup parent once the menu is
                            // dismissed. (Don't count on 0x0 sized shells to be invisible without this)
                            menu.addListener(SWT.Hide, new Listener() {
View Full Code Here

            // so use the activate event.
            // TODO: is it necessary to do this for all parents?
            shellsWithActivateListener = new Stack();
            Shell shell = parentShell;
            while (shell != null) {
                shell.addListener(SWT.Activate, activateListener);
                shellsWithActivateListener.push(shell);
                Composite composite = shell.getParent();
                shell = (composite != null) ? composite.getShell() : null;
            }
        } else {
View Full Code Here

          break;
      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  Listener listener = new Listener () {
    public void handleEvent (Event e) {
      switch (e.type) {
View Full Code Here

      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  Listener listener = new Listener () {
    public void handleEvent (Event e) {
      switch (e.type) {
        case SWT.Dispose:
View Full Code Here

        }
      });
    }
  };
  parent.addComponentListener(listener);
  shell.addListener(SWT.Dispose, new Listener() {
    public void handleEvent(Event event) {
      parent.removeComponentListener(listener);
    }
  });
  shell.setVisible (true);
View Full Code Here

          break;
      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  Listener listener = new Listener () {
    public void handleEvent (Event e) {
      switch (e.type) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.