Package org.eclipse.swt.widgets

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


        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

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

      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
  parent.addListener (SWT.Dispose, new Listener () {
    public void handleEvent (Event event) {
      Shell shell = parent.getShell ();
      shell.removeListener (SWT.Deiconify, shellListener);
      shell.removeListener (SWT.Iconify, shellListener);
View Full Code Here

        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);
        notifyListeners(SWT.FocusIn, new Event());
        display.addFilter(SWT.FocusIn, filter);
        break;
View Full Code Here

            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);
View Full Code Here

          break;
      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  /*
  * Generate the appropriate events to activate and deactivate
  * the embedded frame. This is needed in order to make keyboard
View Full Code Here

      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  /*
  * Generate the appropriate events to activate and deactivate
  * the embedded frame. This is needed in order to make keyboard
  * focus work properly for lightweights.
View Full Code Here

public Shell open(final Display display) {
  Shell shell = new Shell(display);
  shell.setText(getResourceString("UserProvisioning")); //$NON-NLS-1$
  final AccountsUi gui = new AccountsUi(shell);
  shell.addListener(SWT.Close, new Listener() {
    public void handleEvent(Event event) {
      gui.dispose();
    }
  })
  shell.open();
View Full Code Here

          break;
      }
    }
  };
  Shell shell = parent.getShell ();
  shell.addListener (SWT.Deiconify, shellListener);
  shell.addListener (SWT.Iconify, shellListener);
 
  /*
  * Generate the appropriate events to activate and deactivate
  * the embedded frame. This is needed in order to make keyboard
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.