/** * Creates a ControlEditor for the specified Composite. * * @param parent the Composite above which this editor will be displayed */ public ControlEditor( Composite parent ) { this.parent = parent; controlListener = new Listener() { public void handleEvent( Event e ) { layout(); } }; for( int i = 0; i < EVENTS.length; i++ ) { parent.addListener( EVENTS[ i ], controlListener ); } scrollbarListener = new Listener() { public void handleEvent( Event e ) { scroll( e ); } }; ScrollBar hBar = parent.getHorizontalBar(); ScrollBar vBar = parent.getVerticalBar(); if( hBar != null ) { hBar.addListener( SWT.Selection, scrollbarListener ); } if( vBar != null ) { vBar.addListener( SWT.Selection, scrollbarListener ); } }
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener); ScrollBar vBar = parent.getVerticalBar (); if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener); ScrollBar vBar = parent.getVerticalBar (); if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener); ScrollBar vBar = parent.getVerticalBar (); if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
/** * Creates a ControlEditor for the specified Composite. * * @param parent the Composite above which this editor will be displayed * */ public ControlEditor (Composite parent) { this.parent = parent; controlListener = new Listener() { public void handleEvent(Event e) { layout (); } }; for (int i=0; i<EVENTS.length; i++) { parent.addListener (EVENTS [i], controlListener); } scrollbarListener = new Listener() { public void handleEvent(Event e) { scroll (e); } }; ScrollBar hBar = parent.getHorizontalBar (); if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener); ScrollBar vBar = parent.getVerticalBar (); if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener); } Rectangle computeBounds () {
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener); ScrollBar vBar = parent.getVerticalBar (); if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.Selection,typedListener); addListener(SWT.DefaultSelection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener); addListener (SWT.DefaultSelection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener); addListener (SWT.DefaultSelection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener (SWT.Selection,typedListener); addListener (SWT.DefaultSelection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener); addListener (SWT.DefaultSelection,typedListener);
addListener( SWT.Selection, typedListener ); addListener( SWT.DefaultSelection, typedListener );
public ImageCanvas(Composite parent, int style) { super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL); ScrollBar sb= getHorizontalBar(); sb.setIncrement(20); sb.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { repaint(); } }); sb= getVerticalBar(); sb.setIncrement(20); sb.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { repaint(); } }); addListener(SWT.Resize, new Listener() { public void handleEvent(Event e) { updateScrollbars(); } }); addListener(SWT.Paint, new Listener() { public void handleEvent(Event event) { paint(event.gc); } }); }
public ImageCanvas(Composite parent, int style) { super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL); ScrollBar sb= getHorizontalBar(); sb.setIncrement(20); sb.addListener(SWT.Selection, e -> repaint()); sb= getVerticalBar(); sb.setIncrement(20); sb.addListener(SWT.Selection, e -> repaint()); addListener(SWT.Resize, e -> updateScrollbars()); addListener(SWT.Paint, event -> paint(event.gc)); }
verticalBar.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { horizontalBar.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) {
verticalBar.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { horizontalBar.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) {
void installListeners() { // Listeners on this popup's table and scroll bar proposalTable.addListener(SWT.FocusOut, this); ScrollBar scrollbar = proposalTable.getVerticalBar(); if (scrollbar != null) { scrollbar.addListener(SWT.Selection, this); } // Listeners on this popup's shell getShell().addListener(SWT.Deactivate, this); getShell().addListener(SWT.Close, this); // Listeners on the target control control.addListener(SWT.MouseDoubleClick, this); control.addListener(SWT.MouseDown, this); 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); // RAP [if] Don't add a resize listener because of // TextSizeDetermnation // controlShell.addListener(SWT.Resize, this); // RAPEND [if] }
void installListeners() { // Listeners on this popup's table and scroll bar proposalTable.addListener(SWT.FocusOut, this); ScrollBar scrollbar = proposalTable.getVerticalBar(); if (scrollbar != null) { scrollbar.addListener(SWT.Selection, this); } // Listeners on this popup's shell getShell().addListener(SWT.Deactivate, this); getShell().addListener(SWT.Close, this); // Listeners on the target control control.addListener(SWT.MouseDoubleClick, this); control.addListener(SWT.MouseDown, this); 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); }
void installListeners() { // Listeners on this popup's table and scroll bar proposalTable.addListener(SWT.FocusOut, this); ScrollBar scrollbar = proposalTable.getVerticalBar(); if (scrollbar != null) { scrollbar.addListener(SWT.Selection, this); } // Listeners on this popup's shell getShell().addListener(SWT.Deactivate, this); getShell().addListener(SWT.Close, this); // Listeners on the target control control.addListener(SWT.MouseDoubleClick, this); control.addListener(SWT.MouseDown, this); 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); }
e.doit = false; }); getVerticalBar().addListener(SWT.Selection, e -> { setTopPixelSaturated(getVerticalBar().getSelection() + minTopPixel); });