Java 类org.eclipse.jface.text.IViewportListener 实例源码

项目:gwt-eclipse-plugin    文件:DelegatingTextViewer.java   
public void addViewportListener(IViewportListener listener) {
  originalTextViewer.addViewportListener(listener);
}
项目:gwt-eclipse-plugin    文件:DelegatingTextViewer.java   
public void removeViewportListener(IViewportListener listener) {
  originalTextViewer.removeViewportListener(listener);
}
项目:strutsclipse    文件:MockTextViewer.java   
@Override
public void addViewportListener(IViewportListener listener) {
}
项目:strutsclipse    文件:MockTextViewer.java   
@Override
public void removeViewportListener(IViewportListener listener) {
}
项目:Eclipse-Postfix-Code-Completion    文件:AnnotationExpansionControl.java   
/**
     * Creates a new control.
     *
     * @param parent parent shell
     * @param shellStyle additional style flags
     * @param access the annotation access
     */
    public AnnotationExpansionControl(Shell parent, int shellStyle, IAnnotationAccess access) {
        fPaintListener= new MyPaintListener();
        fMouseTrackListener= new MyMouseTrackListener();
        fMouseListener= new MyMouseListener();
        fMenuDetectListener= new MyMenuDetectListener();
        fDisposeListener= new MyDisposeListener();
        fViewportListener= new IViewportListener() {

            public void viewportChanged(int verticalOffset) {
                dispose();
            }

        };
        fLayouter= new LinearLayouter();

        if (access instanceof IAnnotationAccessExtension)
            fAnnotationAccessExtension= (IAnnotationAccessExtension) access;

        fShell= new Shell(parent, shellStyle | SWT.NO_FOCUS | SWT.ON_TOP);
        Display display= fShell.getDisplay();
        fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
        fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM);
//      fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.V_SCROLL);

        GridLayout layout= new GridLayout(1, true);
        layout.marginHeight= 0;
        layout.marginWidth= 0;
        fShell.setLayout(layout);

        GridData data= new GridData(GridData.FILL_BOTH);
        data.heightHint= fLayouter.getAnnotationSize() + 2 * fLayouter.getBorderWidth() + 4;
        fComposite.setLayoutData(data);
        fComposite.addMouseTrackListener(new MouseTrackAdapter() {

            @Override
            public void mouseExit(MouseEvent e) {
                if (fComposite == null)
                        return;
                Control[] children= fComposite.getChildren();
                Rectangle bounds= null;
                for (int i= 0; i < children.length; i++) {
                    if (bounds == null)
                        bounds= children[i].getBounds();
                    else
                        bounds.add(children[i].getBounds());
                    if (bounds.contains(e.x, e.y))
                        return;
                }

                // if none of the children contains the event, we leave the popup
                dispose();
            }

        });

//      fComposite.getVerticalBar().addListener(SWT.Selection, new Listener() {
//
//          public void handleEvent(Event event) {
//              Rectangle bounds= fShell.getBounds();
//              int x= bounds.x - fLayouter.getAnnotationSize() - fLayouter.getBorderWidth();
//              int y= bounds.y;
//              fShell.setBounds(x, y, bounds.width, bounds.height);
//          }
//
//      });

        Cursor handCursor= getHandCursor(display);
        fShell.setCursor(handCursor);
        fComposite.setCursor(handCursor);

        setInfoSystemColor();
    }
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AnnotationExpansionControl.java   
/**
     * Creates a new control.
     *
     * @param parent parent shell
     * @param shellStyle additional style flags
     * @param access the annotation access
     */
    public AnnotationExpansionControl(Shell parent, int shellStyle, IAnnotationAccess access) {
        fPaintListener= new MyPaintListener();
        fMouseTrackListener= new MyMouseTrackListener();
        fMouseListener= new MyMouseListener();
        fMenuDetectListener= new MyMenuDetectListener();
        fDisposeListener= new MyDisposeListener();
        fViewportListener= new IViewportListener() {

            public void viewportChanged(int verticalOffset) {
                dispose();
            }

        };
        fLayouter= new LinearLayouter();

        if (access instanceof IAnnotationAccessExtension)
            fAnnotationAccessExtension= (IAnnotationAccessExtension) access;

        fShell= new Shell(parent, shellStyle | SWT.NO_FOCUS | SWT.ON_TOP);
        Display display= fShell.getDisplay();
        fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
        fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM);
//      fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.V_SCROLL);

        GridLayout layout= new GridLayout(1, true);
        layout.marginHeight= 0;
        layout.marginWidth= 0;
        fShell.setLayout(layout);

        GridData data= new GridData(GridData.FILL_BOTH);
        data.heightHint= fLayouter.getAnnotationSize() + 2 * fLayouter.getBorderWidth() + 4;
        fComposite.setLayoutData(data);
        fComposite.addMouseTrackListener(new MouseTrackAdapter() {

            @Override
            public void mouseExit(MouseEvent e) {
                if (fComposite == null)
                        return;
                Control[] children= fComposite.getChildren();
                Rectangle bounds= null;
                for (int i= 0; i < children.length; i++) {
                    if (bounds == null)
                        bounds= children[i].getBounds();
                    else
                        bounds.add(children[i].getBounds());
                    if (bounds.contains(e.x, e.y))
                        return;
                }

                // if none of the children contains the event, we leave the popup
                dispose();
            }

        });

//      fComposite.getVerticalBar().addListener(SWT.Selection, new Listener() {
//
//          public void handleEvent(Event event) {
//              Rectangle bounds= fShell.getBounds();
//              int x= bounds.x - fLayouter.getAnnotationSize() - fLayouter.getBorderWidth();
//              int y= bounds.y;
//              fShell.setBounds(x, y, bounds.width, bounds.height);
//          }
//
//      });

        Cursor handCursor= getHandCursor(display);
        fShell.setCursor(handCursor);
        fComposite.setCursor(handCursor);

        setInfoSystemColor();
    }
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
@Override
public void addViewportListener(IViewportListener listener) {
    viewer.addViewportListener(listener);
}
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
@Override
public void removeViewportListener(IViewportListener listener) {
    viewer.removeViewportListener(listener);
}