Codota Logo
Composite.addListener
Code IndexAdd Codota to your IDE (free)

How to use
addListener
method
in
org.eclipse.swt.widgets.Composite

Best Java code snippets using org.eclipse.swt.widgets.Composite.addListener (Showing top 20 results out of 324)

  • Common ways to obtain Composite
private void myMethod () {
Composite c =
  • Codota IconControl control;control.getParent()
  • Codota IconStatusDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Codota IconTitleAreaDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

label = new Label( parent, SWT.BORDER );
label.setText( "0 object(s)" );
parent.addListener( SWT.Resize, new Listener() {
 public void handleEvent( Event e ) {
  layout();
origin: pentaho/pentaho-kettle

composite.addListener( SWT.Resize, new Listener() {
 public void handleEvent( Event e ) {
  Rectangle rect = composite.getClientArea();
origin: pentaho/pentaho-kettle

composite.addListener( SWT.Resize, new Listener() {
 public void handleEvent( Event e ) {
  Rectangle rect = composite.getClientArea();
origin: pentaho/pentaho-kettle

composite.addListener( SWT.Resize, new Listener() {
 public void handleEvent( Event e ) {
  Rectangle rect = composite.getClientArea();
origin: BiglySoftware/BiglyBT

@Override
public void
addListener(
  int			type,
  Listener    l )
{
  browser.addListener( type, l );
}
origin: stackoverflow.com

composite.addListener(SWT.Resize, new Listener() {
  public void handleEvent(Event e) {
    changeImage();
origin: org.eclipse/org.eclipse.emf.exporter

protected CompositeEditorHelper(Composite composite)
{
 this.composite = composite;
 composite.addListener(SWT.Selection, this);
 composite.addListener(SWT.DefaultSelection, this);
 composite.addListener(SWT.Dispose, this);
 compositeEditor = createControlEditor(composite);
 compositeEditor.horizontalAlignment = SWT.LEFT;
 compositeEditor.grabHorizontal = true;
}
origin: BiglySoftware/BiglyBT

/**
 * Initialize
 */
public TableTooltips(TableViewSWT tv, Composite composite) {
  this.tv = tv;
  this.composite = composite;
  mainShell = composite.getShell();
  composite.addListener(SWT.Dispose, this);
  composite.addListener(SWT.KeyDown, this);
  composite.addListener(SWT.MouseMove, this);
  composite.addListener(SWT.MouseHover, this);
  composite.addListener(SWT.MouseExit, this);
  mainShell.addListener(SWT.Deactivate, this);
  tv.getComposite().addListener(SWT.Deactivate, this);
}
origin: com.diffplug.durian/durian-swt

/**
 * Performs an asynchronous layout on the given composite anytime that it is resized.
 * <p>
 * This can often fix graphical glitches with resize-to-fit layouts, such as a `TableColumnLayout`.
 */
public static void asyncLayoutOnResize(Composite cmp) {
  cmp.addListener(SWT.Resize, e -> asyncLayout(cmp));
  // trigger the first one by hand
  asyncLayout(cmp);
}
origin: org.eclipse.platform/org.eclipse.ui.workbench

/**
 * Create the control of the inner editor.
 *
 * Must be called by subclass.
 */
public Composite createInnerPartControl(Composite parent,
    final IEditorPart e) {
  Composite content = new Composite(parent, SWT.NONE);
  content.setLayout(new FillLayout());
  e.createPartControl(content);
  parent.addListener(SWT.Activate, event -> {
    if (event.type == SWT.Activate) {
      activateEditor(e);
    }
  });
  return content;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

private void installCompositeListeners(Composite c) {
  if (!c.isDisposed()) {
    printAddListener(c, "PAINT"); //$NON-NLS-1$
    c.addPaintListener(paintListener);
    printAddListener(c, "MOUSETRACK"); //$NON-NLS-1$
    c.addMouseTrackListener(mouseTrackListener);
    printAddListener(c, "SWT.MenuDetect"); //$NON-NLS-1$
    c.addListener(SWT.MenuDetect, compositeListener);
    printAddListener(c, "SWT.MouseDown"); //$NON-NLS-1$
    c.addListener(SWT.MouseDown, compositeListener);
    printAddListener(c, "SWT.MouseDoubleClick"); //$NON-NLS-1$
    c.addListener(SWT.MouseDoubleClick, compositeListener);
  }
}
origin: org.eclipse.platform/org.eclipse.jface

private void installCompositeListeners(Composite c) {
  if (!c.isDisposed()) {
    printAddListener(c, "PAINT"); //$NON-NLS-1$
    c.addPaintListener(paintListener);
    printAddListener(c, "MOUSETRACK"); //$NON-NLS-1$
    c.addMouseTrackListener(mouseTrackListener);
    printAddListener(c, "SWT.MenuDetect"); //$NON-NLS-1$
    c.addListener(SWT.MenuDetect, compositeListener);
    printAddListener(c, "SWT.MouseDown"); //$NON-NLS-1$
    c.addListener(SWT.MouseDown, compositeListener);
    printAddListener(c, "SWT.MouseDoubleClick"); //$NON-NLS-1$
    c.addListener(SWT.MouseDoubleClick, compositeListener);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

private void installCompositeListeners(Composite c) {
 if(!c.isDisposed()) {
  printAddListener(c, "PAINT"); //$NON-NLS-1$
  c.addPaintListener(paintListener);
  printAddListener(c, "MOUSETRACK"); //$NON-NLS-1$
  c.addMouseTrackListener(mouseTrackListener);
  printAddListener(c, "SWT.MenuDetect"); //$NON-NLS-1$
  c.addListener(SWT.MenuDetect, compositeListener);
  printAddListener(c, "SWT.MouseDown"); //$NON-NLS-1$
  c.addListener(SWT.MouseDown, compositeListener);
  printAddListener(c, "SWT.MouseDoubleClick"); //$NON-NLS-1$
  c.addListener(SWT.MouseDoubleClick, compositeListener);
 }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms

private void installActivationListener() {
  if (activationListener == null) {
    activationListener = new Listener() {
      @Override
      public void handleEvent(Event event) {
        boolean wasHeaderActive = event.widget != getContainer();
        int activePage = getActivePage();
        if (SharedHeaderFormEditor.this.wasHeaderActive != wasHeaderActive && activePage != -1 && pages.get(activePage) instanceof IEditorPart) {
          if (wasHeaderActive) {
            deactivateSite(true, true);
          } else {
            activateSite();
          }
        }
        SharedHeaderFormEditor.this.wasHeaderActive = wasHeaderActive;
      }
    };
    getContainer().addListener(SWT.Activate, activationListener);
    getHeaderForm().getForm().getForm().getHead().addListener(SWT.Activate, activationListener);
  }
}
origin: com.eclipsesource.tabris/tabris

/**
 * <p>
 * Adds a {@link Listener} for the defined eventType. The listener will be notified when the event occurs anywhere
 * on the {@link Composite}. It doesn't matter if the {@link Composite} holds controls or not.
 * </p>
 *
 * @since 0.10
 */
public void addGroupedListener( int eventType, Listener listener )
 throws IllegalArgumentException, IllegalStateException
{
 whenNull( listener ).throwIllegalArgument( "Listener must not be null" );
 Composite facade = getFacade();
 facade.addListener( eventType, listener );
}
origin: BiglySoftware/BiglyBT

/**
 * @param area
 * @param event id
 * @param listener
 */
public static void addListenerAndChildren(Composite area, int event,
    Listener listener) {
  area.addListener(event, listener);
  Control[] children = area.getChildren();
  for (int i = 0; i < children.length; i++) {
    Control child = children[i];
    if (child instanceof Composite) {
      addListenerAndChildren((Composite) child, event, listener);
    } else {
      child.addListener(event, listener);
    }
  }
}
origin: org.eclipse.mylyn.builds/ui

/**
 * Initializes automatic resize of the tree control columns. The size of these will be adjusted when a node is
 * expanded or collapsed and when the tree changes size.
 * 
 * @param tree
 *            the tree to resize
 */
private void installAutomaticResize(final Tree tree) {
  Listener listener = new Listener() {
    public void handleEvent(Event e) {
      packColumnsAsync(tree);
    }
  };
  // Automatically resize columns when we expand tree nodes.
  tree.addListener(SWT.Collapse, listener);
  tree.addListener(SWT.Expand, listener);
  tree.getParent().addListener(SWT.Resize, listener);
}
origin: org.eclipse.e4.ui.workbench.addons/swt

private Composite getHostPane() {
  if (hostPane != null) {
    setHostSize(); // Always start with the persisted size
    return hostPane;
  }
  // Create one
  hostPane = new Composite(trimStackTB.getShell(), SWT.NONE);
  hostPane.setData(ShellActivationListener.DIALOG_IGNORE_KEY, Boolean.TRUE);
  setHostSize();
  hostPane.addListener(SWT.Traverse, escapeListener);
  // Set a special layout that allows resizing
  fixedSides = getFixedSides();
  hostPane.setLayout(new TrimPaneLayout(toolControl, fixedSides));
  return hostPane;
}
origin: org.eclipse.platform/org.eclipse.ui.forms

private void installActivationListener() {
  if (activationListener == null) {
    activationListener = event -> {
      boolean wasHeaderActive = event.widget != getContainer();
      int activePage = getActivePage();
      if (SharedHeaderFormEditor.this.wasHeaderActive != wasHeaderActive && activePage != -1
          && pages.get(activePage) instanceof IEditorPart) {
        if (wasHeaderActive) {
          deactivateSite(true, true);
        } else {
          activateSite();
        }
      }
      SharedHeaderFormEditor.this.wasHeaderActive = wasHeaderActive;
    };
    getContainer().addListener(SWT.Activate, activationListener);
    getHeaderForm().getForm().getForm().getHead().addListener(SWT.Activate, activationListener);
  }
}
origin: stackoverflow.com

public static void main(String[] args) {
 Display display = new Display();
 final Shell shell = new Shell(display);
 shell.open();
 final Composite b = new Composite(shell, SWT.NONE);
 b.setBounds(20, 20, 80, 80);
 b.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
 b.addListener(SWT.MouseDown, new Listener() {
  public void handleEvent(Event e) {
   Tracker tracker = new Tracker(b.getParent(), SWT.RESIZE);
   tracker.setStippled(true);
   Rectangle rect = b.getBounds();
   tracker.setRectangles(new Rectangle[] { rect });
   if (tracker.open()) {
    Rectangle after = tracker.getRectangles()[0];
    b.setBounds(after);
   }
   tracker.dispose();
  }
 });
 while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
   display.sleep();
 }
 display.dispose();
}
org.eclipse.swt.widgetsCompositeaddListener

Popular methods of Composite

  • setLayout
    Sets the layout which is associated with the receiver to be the argument which may be null.
  • <init>
    Constructs a new instance of this class given its parent and a style value describing its behavior a
  • setLayoutData
  • layout
    Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarc
  • getDisplay
  • getChildren
    Returns a (possibly empty) array containing the receiver's children. Children are returned in the or
  • getShell
  • getFont
  • getLayout
    Returns layout which is associated with the receiver, or null if one has not been set.
  • setFont
  • getParent
  • computeSize
  • getParent,
  • computeSize,
  • dispose,
  • setBackground,
  • getClientArea,
  • isDisposed,
  • getBackground,
  • setVisible,
  • setSize,
  • setData

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now