org.eclipse.swt.events.ControlListener Java Examples
The following examples show how to use
org.eclipse.swt.events.ControlListener.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GridColumn_Test.java From nebula with Eclipse Public License 2.0 | 5 votes |
@Test public void testAddRemoveControlListener() { ControlListener listener = new ControlAdapter() { }; assertFalse( column.isListening( SWT.Move ) ); assertFalse( column.isListening( SWT.Resize ) ); column.addControlListener( listener ); assertTrue( column.isListening( SWT.Move ) ); assertTrue( column.isListening( SWT.Resize ) ); column.removeControlListener( listener ); assertFalse( column.isListening( SWT.Move ) ); assertFalse( column.isListening( SWT.Resize ) ); }
Example #2
Source File: ScrollView.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
/** * Remove the local Listener and add the new listener. * * @param nlistener the new listener */ public void replaceControlListener(ControlListener nlistener) { if (fLocalControlListener != null) { removeControlListener(fLocalControlListener); fLocalControlListener = null; } addControlListener(nlistener); }
Example #3
Source File: CTreeColumn.java From nebula with Eclipse Public License 2.0 | 5 votes |
public void addControlListener(ControlListener listener) { if(isNative) { nativeColumn.addControlListener(listener); } else { // TODO } }
Example #4
Source File: CTreeColumn.java From nebula with Eclipse Public License 2.0 | 5 votes |
public void removeControlListener(ControlListener listener) { if(isNative) { nativeColumn.removeControlListener(listener); } else { // TODO } }
Example #5
Source File: ChartComposite.java From SIMVA-SoS with Apache License 2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #6
Source File: ChartComposite.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #7
Source File: AbstractPyEditorTextHover.java From Pydev with Eclipse Public License 1.0 | 4 votes |
/** * Add a listener to resize events on the information presented control. * @param listener the resize listener */ public void addInformationPresenterControlListener(ControlListener listener) { if (informationPresenter != null) { informationPresenter.addResizeCallback(listener); } }
Example #8
Source File: ChartComposite.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(SWTEventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); } else if (listener instanceof DragDetectListener) { this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); } else if (listener instanceof MenuDetectListener) { this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); } else if (listener instanceof MouseWheelListener) { this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #9
Source File: ChartComposite.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); } else if (listener instanceof DragDetectListener) { this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); } else if (listener instanceof MenuDetectListener) { this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); } else if (listener instanceof MouseWheelListener) { this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #10
Source File: ChartComposite.java From ECG-Viewer with GNU General Public License v2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #11
Source File: RenameInformationPopup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private void addMoveSupport(final Shell popupShell, final Control movedControl) { movedControl.addMouseListener(new MouseAdapter() { @Override public void mouseDown(final MouseEvent downEvent) { if (downEvent.button != 1) { return; } final Point POPUP_SOURCE= popupShell.getLocation(); final StyledText textWidget= fEditor.getViewer().getTextWidget(); Point pSize= getExtent(); int originalSnapPosition= fSnapPosition; /* * Feature in Tracker: it is not possible to directly control the feedback, * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=121300 * and https://bugs.eclipse.org/bugs/show_bug.cgi?id=121298#c1 . * * Workaround is to have an offscreen rectangle for tracking mouse movement * and a manually updated rectangle for the actual drop target. */ final Tracker tracker= new Tracker(textWidget, SWT.NONE); final Point[] LOCATIONS= { textWidget.toControl(computePopupLocation(SNAP_POSITION_UNDER_RIGHT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_OVER_RIGHT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_UNDER_LEFT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_OVER_LEFT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_LOWER_RIGHT)) }; final Rectangle[] DROP_TARGETS= { Geometry.createRectangle(LOCATIONS[0], pSize), Geometry.createRectangle(LOCATIONS[1], pSize), new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y), Geometry.createRectangle(LOCATIONS[3], pSize), Geometry.createRectangle(LOCATIONS[4], pSize) }; final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0); tracker.setRectangles(new Rectangle[] { MOUSE_MOVE_SOURCE, DROP_TARGETS[fSnapPosition] }); tracker.setStippled(true); ControlListener moveListener= new ControlAdapter() { /* * @see org.eclipse.swt.events.ControlAdapter#controlMoved(org.eclipse.swt.events.ControlEvent) */ @Override public void controlMoved(ControlEvent moveEvent) { Rectangle[] currentRects= tracker.getRectangles(); final Rectangle mouseMoveCurrent= currentRects[0]; Point popupLoc= new Point( POPUP_SOURCE.x + mouseMoveCurrent.x - MOUSE_MOVE_SOURCE.x, POPUP_SOURCE.y + mouseMoveCurrent.y - MOUSE_MOVE_SOURCE.y); popupShell.setLocation(popupLoc); Point ePopupLoc= textWidget.toControl(popupLoc); int minDist= Integer.MAX_VALUE; for (int snapPos= 0; snapPos < DROP_TARGETS.length; snapPos++) { int dist= Geometry.distanceSquared(ePopupLoc, LOCATIONS[snapPos]); if (dist < minDist) { minDist= dist; fSnapPosition= snapPos; fSnapPositionChanged= true; currentRects[1]= DROP_TARGETS[snapPos]; } } tracker.setRectangles(currentRects); } }; tracker.addControlListener(moveListener); boolean committed= tracker.open(); tracker.close(); tracker.dispose(); if (committed) { getDialogSettings().put(SNAP_POSITION_KEY, fSnapPosition); } else { fSnapPosition= originalSnapPosition; fSnapPositionChanged= true; } updatePopupLocation(true); activateEditor(); } }); }
Example #12
Source File: RenameInformationPopup.java From typescript.java with MIT License | 4 votes |
private void addMoveSupport(final Shell popupShell, final Control movedControl) { movedControl.addMouseListener(new MouseAdapter() { @Override public void mouseDown(final MouseEvent downEvent) { if (downEvent.button != 1) { return; } final Point POPUP_SOURCE= popupShell.getLocation(); final StyledText textWidget= fEditor.getViewer().getTextWidget(); Point pSize= getExtent(); int originalSnapPosition= fSnapPosition; /* * Feature in Tracker: it is not possible to directly control the feedback, * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=121300 * and https://bugs.eclipse.org/bugs/show_bug.cgi?id=121298#c1 . * * Workaround is to have an offscreen rectangle for tracking mouse movement * and a manually updated rectangle for the actual drop target. */ final Tracker tracker= new Tracker(textWidget, SWT.NONE); final Point[] LOCATIONS= { textWidget.toControl(computePopupLocation(SNAP_POSITION_UNDER_RIGHT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_OVER_RIGHT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_UNDER_LEFT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_OVER_LEFT_FIELD)), textWidget.toControl(computePopupLocation(SNAP_POSITION_LOWER_RIGHT)) }; final Rectangle[] DROP_TARGETS= { Geometry.createRectangle(LOCATIONS[0], pSize), Geometry.createRectangle(LOCATIONS[1], pSize), new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y), Geometry.createRectangle(LOCATIONS[3], pSize), Geometry.createRectangle(LOCATIONS[4], pSize) }; final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0); tracker.setRectangles(new Rectangle[] { MOUSE_MOVE_SOURCE, DROP_TARGETS[fSnapPosition] }); tracker.setStippled(true); ControlListener moveListener= new ControlAdapter() { /* * @see org.eclipse.swt.events.ControlAdapter#controlMoved(org.eclipse.swt.events.ControlEvent) */ @Override public void controlMoved(ControlEvent moveEvent) { Rectangle[] currentRects= tracker.getRectangles(); final Rectangle mouseMoveCurrent= currentRects[0]; Point popupLoc= new Point( POPUP_SOURCE.x + mouseMoveCurrent.x - MOUSE_MOVE_SOURCE.x, POPUP_SOURCE.y + mouseMoveCurrent.y - MOUSE_MOVE_SOURCE.y); popupShell.setLocation(popupLoc); Point ePopupLoc= textWidget.toControl(popupLoc); int minDist= Integer.MAX_VALUE; for (int snapPos= 0; snapPos < DROP_TARGETS.length; snapPos++) { int dist= Geometry.distanceSquared(ePopupLoc, LOCATIONS[snapPos]); if (dist < minDist) { minDist= dist; fSnapPosition= snapPos; fSnapPositionChanged= true; currentRects[1]= DROP_TARGETS[snapPos]; } } tracker.setRectangles(currentRects); } }; tracker.addControlListener(moveListener); boolean committed= tracker.open(); tracker.close(); tracker.dispose(); if (committed) { getDialogSettings().put(SNAP_POSITION_KEY, fSnapPosition); } else { fSnapPosition= originalSnapPosition; fSnapPositionChanged= true; } updatePopupLocation(true); activateEditor(); } }); }
Example #13
Source File: ChartComposite.java From openstock with GNU General Public License v3.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #14
Source File: ChartComposite.java From ccu-historian with GNU General Public License v3.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); // } // else if (listener instanceof DragDetectListener) { // this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); // } // else if (listener instanceof MenuDetectListener) { // this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); // } else if (listener instanceof MouseWheelListener) { // this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #15
Source File: CalendarCombo.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void removeControlListener(ControlListener listener) { mComboControl.removeControlListener(listener); }
Example #16
Source File: CalendarCombo.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void addControlListener(ControlListener listener) { mComboControl.addControlListener(listener); }
Example #17
Source File: AbstractNativeHeader.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void controlMoved(ControlEvent e) { for (Iterator i = columnControlListeners.iterator(); i.hasNext();) { ControlListener listener = (ControlListener) i.next(); listener.controlMoved(e); } }
Example #18
Source File: AbstractNativeHeader.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void controlResized(ControlEvent e) { for (Iterator i = columnControlListeners.iterator(); i.hasNext();) { ControlListener listener = (ControlListener) i.next(); listener.controlResized(e); } }
Example #19
Source File: AbstractNativeHeader.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void removeColumnControlListener(ControlListener c) { columnControlListeners.remove(c); }
Example #20
Source File: AbstractNativeHeader.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void addColumnControlListener(ControlListener c) { columnControlListeners.add(c); }
Example #21
Source File: GridColumn.java From translationstudio8 with GNU General Public License v2.0 | 3 votes |
/** * Removes the given control listener. * * @param listener * listener. * @throws IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @throws org.eclipse.swt.SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * </li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void removeControlListener(ControlListener listener) { checkWidget(); if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } removeListener(SWT.Resize, listener); removeListener(SWT.Move, listener); }
Example #22
Source File: GridItem.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Adds the listener to the collection of listeners who will be notified * when the row is resized, by sending it one of the messages defined in the * <code>ControlListener</code> interface. * <p> * Clients who wish to override the standard row resize logic should use the * untyped listener mechanisms. The untyped <code>Event</code> object passed * to an untyped listener will have its <code>detail</code> field populated * with the new row height. Clients may alter this value to, for example, * enforce minimum or maximum row sizes. Clients may also set the * <code>doit</code> field to false to prevent the entire resize operation. * * @param listener * the listener which should be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void addControlListener(ControlListener listener) { checkWidget(); if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.Resize, typedListener); }
Example #23
Source File: GridItem.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Removes the listener from the collection of listeners who will be * notified when the row is resized. * * @param listener * the listener which should no longer be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void removeControlListener(ControlListener listener) { checkWidget(); if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); removeListener(SWT.Resize, listener); }
Example #24
Source File: GridColumn.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * Removes the given control listener. * * @param listener * listener. * @throws IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @throws org.eclipse.swt.SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * </li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void removeControlListener(ControlListener listener) { checkWidget(); if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } removeListener(SWT.Resize, listener); removeListener(SWT.Move, listener); }
Example #25
Source File: GridColumn.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * Adds a listener to the list of listeners notified when the column is * moved or resized. * * @param listener * listener * @throws IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @throws org.eclipse.swt.SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * </li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void addControlListener(ControlListener listener) { checkWidget(); if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } TypedListener typedListener = new TypedListener(listener); addListener(SWT.Resize, typedListener); addListener(SWT.Move, typedListener); }
Example #26
Source File: GridItem.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * Removes the listener from the collection of listeners who will be * notified when the row is resized. * * @param listener * the listener which should no longer be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void removeControlListener(ControlListener listener) { checkWidget(); if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); removeListener(SWT.Resize, listener); }
Example #27
Source File: GridItem.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * Adds the listener to the collection of listeners who will be notified * when the row is resized, by sending it one of the messages defined in the * <code>ControlListener</code> interface. * <p> * Clients who wish to override the standard row resize logic should use the * untyped listener mechanisms. The untyped <code>Event</code> object passed * to an untyped listener will have its <code>detail</code> field populated * with the new row height. Clients may alter this value to, for example, * enforce minimum or maximum row sizes. Clients may also set the * <code>doit</code> field to false to prevent the entire resize operation. * * @param listener * the listener which should be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been * disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if not * called from the thread that created the receiver</li> * </ul> */ public void addControlListener(ControlListener listener) { checkWidget(); if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.Resize, typedListener); }
Example #28
Source File: GridColumn.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Adds a listener to the list of listeners notified when the column is * moved or resized. * * @param listener * listener * @throws IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @throws org.eclipse.swt.SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * </li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void addControlListener(ControlListener listener) { checkWidget(); if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } TypedListener typedListener = new TypedListener(listener); addListener(SWT.Resize, typedListener); addListener(SWT.Move, typedListener); }
Example #29
Source File: GridColumn.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Removes the given control listener. * * @param listener * listener. * @throws IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @throws org.eclipse.swt.SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed * </li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void removeControlListener(ControlListener listener) { checkWidget(); if (listener == null) { SWT.error(SWT.ERROR_NULL_ARGUMENT); } removeListener(SWT.Resize, listener); removeListener(SWT.Move, listener); }
Example #30
Source File: PasswordRevealer.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Adds the listener to the collection of listeners who will * be notified when the control is moved or resized, by sending * it one of the messages defined in the <code>ControlListener</code> * interface. * * @param listener the listener which should be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see ControlListener * @see #removeControlListener */ @Override public void addControlListener(final ControlListener listener) { super.addControlListener(listener); comp.addControlListener(listener); passwordField.addControlListener(listener); }