Package org.eclipse.swt.widgets

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


      }
    }
  };
  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

  public Shell createShell(final Display display) {
    final Shell shell = new Shell(display, SWT.TITLE);
    // final Shell shell = new Shell(display);
    shell.setText("About SAM...");
    shell.addListener(SWT.Close, new Listener() {
      public void handleEvent(Event event) {
        shell.dispose();
        display.dispose();
      }
    });
View Full Code Here

  public Shell createShell(final Display display) {
    final Shell shell = new Shell(display, SWT.TITLE);
    // final Shell shell = new Shell(display);
    shell.setText("About SAM...");
    shell.addListener(SWT.Close, new Listener() {
      public void handleEvent(Event event) {
        shell.dispose();
        display.dispose();
      }
    });
View Full Code Here

    shell.setLayout(gridLayout);

    /*
     * Enabling window close pressing escape
     */
    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

  public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display, SWT.CLOSE | SWT.TITLE);
    shell.setText("Guild Wars : ESM");

    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

      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);
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);
      display.addFilter (SWT.FocusIn, filter);
      Event e = new Event ();
      notifyListeners (SWT.FocusIn, e);
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);
        display.addFilter (SWT.FocusIn, filter);
        Event e = new Event ();
        notifyListeners (SWT.FocusIn, e);
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);
      display.addFilter (SWT.FocusIn, filter);
      Event e = new Event ();
      notifyListeners (SWT.FocusIn, e);
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.