Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Scrollable


    else if (element instanceof EntityGroup)
      eraseGroup(event, (EntityGroup) element);
  }

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

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

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

      ILabel label = news.getLabels().iterator().next();
      if (isInvalidLabelColor(label))
        return;

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

      /* Paint the selection beyond the end of last column */
      expandRegion(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_WHITE));

      /* 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 */
      expandRegion(event, scrollable, gc, clArea);

View Full Code Here


    return label.getColor().equals(LABEL_COLOR_BLACK) || label.getColor().equals(LABEL_COLOR_WHITE);
  }

  private void eraseGroup(Event event, @SuppressWarnings("unused")
  EntityGroup group) {
    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 */
    expandRegion(event, scrollable, gc, area);

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

    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

    else if (element instanceof EntityGroup)
      eraseGroup(event, (EntityGroup) element);
  }

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

    /* Handle selected News */
    if ((event.detail & SWT.SELECTED) != 0) {

      /* Some conditions under which we don't override the selection color */
      if (news.getLabel() == null || !scrollable.isFocusControl())
        return;

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

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

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

      /* 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 */
      expandRegion(event, scrollable, gc, clArea);

View Full Code Here

    }
  }

  private void eraseGroup(Event event, @SuppressWarnings("unused")
  EntityGroup group) {
    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 */
    expandRegion(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 */
      expandRegion(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 enabled
         */
        private void setEnabled( final boolean enabled ) {

            final Scrollable control = owningFeatureTableControl.getViewer().getTable();
            final int size;
            if (!enabled)
                size = input.size();
            else
                size = IProgressMonitor.UNKNOWN;

            control.getDisplay().asyncExec(new Runnable(){
                public void run() {

                    UiPlugin.trace(Trace.FEATURE_TABLE, FeatureTableContentProvider.class,
                            "ContentLoader#setEnabled():"+enabled, null); //$NON-NLS-1$
                    if (enabled) {
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.