Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Scrollable


    if (!OwlUI.isHighContrast()) {
      fItemViewer.getControl().addListener(SWT.EraseItem, new Listener() {
        public void handleEvent(Event event) {
          ToolBarItem item = (ToolBarItem) event.item.getData();
          if (item.item == CoolBarItem.SEPARATOR) {
            Scrollable scrollable = (Scrollable) event.widget;
            GC gc = event.gc;

            Rectangle area = scrollable.getClientArea();
            Rectangle rect = event.getBounds();

            /* Paint the selection beyond the end of last column */
            OwlUI.codExpandRegion(event, scrollable, gc, area);

View Full Code Here


      eraseGroup(event, (EntityGroup) element);

  }

  private void eraseGroup(Event event, EntityGroup group) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    /* Draw Color if Selected */
    if (group.getColorHint() != null && (event.detail & SWT.SELECTED) != 0) {

      /* Some conditions under which we don't override the selection color */
      if (!scrollable.isFocusControl() || isInvalidColor(group.getColorHint()))
        return;

      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, group.getColorHint()));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
    }

View Full Code Here

    else
      OwlUI.codDrawGradient(event, fGradientFgColor, fGradientBgColor, fGradientEndColor);
  }

  private void eraseNews(Event event, INews news) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    /* Handle selected News (Linux: Note Bug 444) */
    if ((event.detail & SWT.SELECTED) != 0 && (Application.IS_WINDOWS || !news.isFlagged())) {

      /* Do not override selection color if not focus control */
      if (!scrollable.isFocusControl())
        return;

      /* Load Labels */
      Set<ILabel> labels = CoreUtils.getSortedLabels(news);
      if (labels.isEmpty())
        return;

      ILabel label = labels.iterator().next();
      if (isInvalidColor(label))
        return;

      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, label));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
    }

    /* Handle Non-Selected flagged News */
    else if (news.isFlagged()) {
      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, clArea);

View Full Code Here

   * @param fg gradient foreground.
   * @param bg gradient background.
   * @param end gradient end.
   */
  public static void codDrawGradient(Event event, Color fg, Color bg, Color end) {
    Scrollable scrollable = (Scrollable) event.widget;
    GC gc = event.gc;

    Rectangle area = scrollable.getClientArea();
    Rectangle rect = event.getBounds();

    /* Paint the selection beyond the end of last column */
    codExpandRegion(event, scrollable, gc, area);

View Full Code Here

      return null;
    }

    void eraseGroup(Event event) {
      Scrollable scrollable = (Scrollable) event.widget;
      GC gc = event.gc;

      Rectangle area = scrollable.getClientArea();
      Rectangle rect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      OwlUI.codExpandRegion(event, scrollable, gc, area);

View Full Code Here

                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

   * @see 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

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.