org.eclipse.swt.events.ShellListener#org.eclipse.swt.events.ControlListener源码实例Demo

下面列出了org.eclipse.swt.events.ShellListener#org.eclipse.swt.events.ControlListener 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: nebula   文件: GridColumn_Test.java
@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 ) );
}
 
源代码2 项目: nebula   文件: CTreeColumn.java
public void addControlListener(ControlListener listener) {
	if(isNative) {
		nativeColumn.addControlListener(listener);
	} else {
		// TODO
	}
}
 
源代码3 项目: nebula   文件: CTreeColumn.java
public void removeControlListener(ControlListener listener) {
	if(isNative) {
		nativeColumn.removeControlListener(listener);
	} else {
		// TODO
	}
}
 
源代码4 项目: tracecompass   文件: ScrollView.java
/**
 * 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);
}
 
源代码5 项目: openstock   文件: ChartComposite.java
/**
     * 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);
        }
    }
 
源代码6 项目: nebula   文件: AbstractNativeHeader.java
public void addColumnControlListener(ControlListener c) {
    columnControlListeners.add(c);
}
 
源代码7 项目: nebula   文件: AbstractNativeHeader.java
public void removeColumnControlListener(ControlListener c) {
    columnControlListeners.remove(c);
}
 
源代码8 项目: nebula   文件: AbstractNativeHeader.java
public void controlResized(ControlEvent e) {
    for (Iterator i = columnControlListeners.iterator(); i.hasNext();) {
        ControlListener listener = (ControlListener) i.next();
        listener.controlResized(e);
    }
}
 
源代码9 项目: nebula   文件: AbstractNativeHeader.java
public void controlMoved(ControlEvent e) {
    for (Iterator i = columnControlListeners.iterator(); i.hasNext();) {
        ControlListener listener = (ControlListener) i.next();
        listener.controlMoved(e);
    }
}
 
源代码10 项目: nebula   文件: CalendarCombo.java
public void addControlListener(ControlListener listener) {
    mComboControl.addControlListener(listener);
}
 
源代码11 项目: nebula   文件: CalendarCombo.java
public void removeControlListener(ControlListener listener) {
    mComboControl.removeControlListener(listener);
}
 
源代码12 项目: ccu-historian   文件: ChartComposite.java
/**
     * 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);
        }
    }
 
源代码13 项目: SIMVA-SoS   文件: ChartComposite.java
/**
     * 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);
        }
    }
 
源代码14 项目: typescript.java   文件: RenameInformationPopup.java
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();
		}
	});
}
 
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();
		}
	});
}
 
源代码16 项目: ECG-Viewer   文件: ChartComposite.java
/**
     * 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);
        }
    }
 
源代码17 项目: astor   文件: ChartComposite.java
/**
 * 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);
    }
}
 
源代码18 项目: astor   文件: ChartComposite.java
/**
 * 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);
    } 
}
 
源代码19 项目: Pydev   文件: AbstractPyEditorTextHover.java
/**
 * 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);
    }
}
 
源代码20 项目: buffer_bci   文件: ChartComposite.java
/**
     * 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);
        }
    }
 
源代码21 项目: nebula   文件: GridItem.java
/**
 * 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);
}
 
源代码22 项目: nebula   文件: GridItem.java
/**
 * 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);
}
 
源代码23 项目: nebula   文件: GridColumn.java
/**
 * 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);
}
 
源代码24 项目: nebula   文件: GridColumn.java
/**
 * 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);
}
 
源代码25 项目: nebula   文件: PasswordRevealer.java
/**
 * 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);
}
 
源代码26 项目: nebula   文件: PasswordRevealer.java
/**
 * Removes the listener from the collection of listeners who will
 * be notified when the control is moved or 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>
 *
 * @see ControlListener
 * @see #addControlListener
 */
@Override
public void removeControlListener(final ControlListener listener) {
	super.removeControlListener(listener);
	comp.removeControlListener(listener);
	passwordField.removeControlListener(listener);
}
 
源代码27 项目: translationstudio8   文件: GridItem.java
/**
 * 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);
}
 
源代码28 项目: translationstudio8   文件: GridItem.java
/**
 * 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);
}
 
源代码29 项目: translationstudio8   文件: GridColumn.java
/**
 * 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);
}
 
源代码30 项目: translationstudio8   文件: GridColumn.java
/**
 * 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);
}