Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Scrollable


            }
            return GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).hint(Geometry.max(button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true), LayoutConstants.getMinButtonSize()));
        }

        if (control instanceof Scrollable) {
            Scrollable scrollable = (Scrollable) control;

            if (scrollable instanceof Composite) {
                Composite composite = (Composite) control;

                Layout theLayout = composite.getLayout();
View Full Code Here


   * org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite,
   * boolean)
   */
  protected void layout(Composite composite, boolean flushCache) {
    Rectangle area = composite.getClientArea();
    Scrollable table = getControl(composite);
    int tableWidth = table.getSize().x;
    int trim = computeTrim(area, table, tableWidth);
    int width = Math.max(0, area.width - trim);

    if (width > 1)
      layoutTableTree(table, width, area, tableWidth < area.width);
View Full Code Here

    if (event.index == 3) {
      if (element instanceof IDownload) {
        IDownload lDownload = (IDownload) element;
        sLog.info("paint(): " + lDownload.getAttachment().getFileName());
        // This is the total client area.
        Scrollable lScrollable = (Scrollable) event.widget;
        Rectangle lClient = lScrollable.getClientArea();

        Rectangle rect = event.getBounds();
        int lColumnWidth = mViewer.mTableViewer.getTable().getColumn(
            event.index).getWidth();
        rect.width = lColumnWidth;
View Full Code Here

        fSubjectControl.addMouseListener(this);
        fSubjectControl.addMouseMoveListener(this);
        fSubjectControl.addControlListener(this);
        fSubjectControl.addKeyListener(this);
        if (fSubjectControl instanceof Scrollable) {
          Scrollable scrollable= (Scrollable) fSubjectControl;
          ScrollBar vBar= scrollable.getVerticalBar();
          if (vBar != null)
            vBar.addSelectionListener(this);
          ScrollBar hBar= scrollable.getHorizontalBar();
          if (hBar != null)
            hBar.addSelectionListener(this);
        }
       
        fDisplay= fSubjectControl.getDisplay();
View Full Code Here

        fSubjectControl.removeMouseListener(this);
        fSubjectControl.removeMouseMoveListener(this);
        fSubjectControl.removeControlListener(this);
        fSubjectControl.removeKeyListener(this);
        if (fSubjectControl instanceof Scrollable) {
          Scrollable scrollable= (Scrollable) fSubjectControl;
          ScrollBar vBar= scrollable.getVerticalBar();
          if (vBar != null)
            vBar.removeSelectionListener(this);
          ScrollBar hBar= scrollable.getHorizontalBar();
          if (hBar != null)
            hBar.removeSelectionListener(this);
        }
      }
View Full Code Here

     * @param control
     */
    private void computeHintOffset(Control control) {
        if (control instanceof Scrollable) {
            // For scrollables, subtract off the trim size
            Scrollable scrollable = (Scrollable) control;
            Rectangle trim = scrollable.computeTrim(0, 0, 0, 0);

            widthAdjustment = trim.width;
            heightAdjustment = trim.height;
        } else {
            // For non-composites, subtract off 2 * the border size
View Full Code Here

            ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;

            // remember the difference from client area to body region area
            // needed because the scrollbar will be removed and therefore the
            // client area will become bigger
            Scrollable scrollable = clientAreaResizeCommand.getScrollable();
            Rectangle clientArea = scrollable.getClientArea();
            Rectangle calcArea = clientAreaResizeCommand.getCalcArea();
            int widthDiff = clientArea.width - calcArea.width;
            int heightDiff = clientArea.height - calcArea.height;

            if (this.hBarListener == null && this.horizontalScrollbarEnabled) {
                ScrollBar hBar = scrollable.getHorizontalBar();

                if (this.horizontalScroller != null) {
                    hBar.setEnabled(false);
                    hBar.setVisible(false);
                } else {
                    this.horizontalScroller = new ScrollBarScroller(hBar);
                }

                this.hBarListener = new HorizontalScrollBarHandler(this, this.horizontalScroller);

                if (scrollable instanceof NatTable) {
                    this.hBarListener.setTable((NatTable) scrollable);
                }
            }

            if (this.vBarListener == null && this.verticalScrollbarEnabled) {
                ScrollBar vBar = scrollable.getVerticalBar();

                if (this.verticalScroller != null) {
                    vBar.setEnabled(false);
                    vBar.setVisible(false);
                } else {
View Full Code Here

     * @param control
     */
    private void computeHintOffset(Control control) {
        if (control instanceof Scrollable) {
            // For scrollables, subtract off the trim size
            Scrollable scrollable = (Scrollable) control;
            Rectangle trim = scrollable.computeTrim(0, 0, 0, 0);

            widthAdjustment = trim.width;
            heightAdjustment = trim.height;
        } else {
            // For non-composites, subtract off 2 * the border size
View Full Code Here

        fSubjectControl.addMouseListener(this);
        fSubjectControl.addMouseMoveListener(this);
        fSubjectControl.addControlListener(this);
        fSubjectControl.addKeyListener(this);
        if (fSubjectControl instanceof Scrollable) {
          Scrollable scrollable= (Scrollable) fSubjectControl;
          ScrollBar vBar= scrollable.getVerticalBar();
          if (vBar != null)
            vBar.addSelectionListener(this);
          ScrollBar hBar= scrollable.getHorizontalBar();
          if (hBar != null)
            hBar.addSelectionListener(this);
        }

        fDisplay= fSubjectControl.getDisplay();
View Full Code Here

        fSubjectControl.removeMouseListener(this);
        fSubjectControl.removeMouseMoveListener(this);
        fSubjectControl.removeControlListener(this);
        fSubjectControl.removeKeyListener(this);
        if (fSubjectControl instanceof Scrollable) {
          Scrollable scrollable= (Scrollable) fSubjectControl;
          ScrollBar vBar= scrollable.getVerticalBar();
          if (vBar != null)
            vBar.removeSelectionListener(this);
          ScrollBar hBar= scrollable.getHorizontalBar();
          if (hBar != null)
            hBar.removeSelectionListener(this);
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Scrollable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.