Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Widget


    IContentProvider cp = getContentProvider();
    if (cp instanceof ITreePathContentProvider) {
      ITreePathContentProvider tpcp = (ITreePathContentProvider) cp;
      if (path == null) {
        // A path was not provided so try and find one
        Widget w = findItem(element);
        if (w instanceof Item) {
          Item item = (Item) w;
          path = getTreePathFromItem(item);
        }
        if (path == null) {
View Full Code Here


  /**
   * This implementation of reveal() reveals the given element or tree path.
   */
  public void reveal(Object elementOrTreePath) {
    Assert.isNotNull(elementOrTreePath);
    Widget w = internalExpand(elementOrTreePath, true);
    if (w instanceof Item) {
      showItem((Item) w);
    }
  }
View Full Code Here

   */
  public void setExpandedState(Object elementOrTreePath, boolean expanded) {
    Assert.isNotNull(elementOrTreePath);
    if (checkBusy())
      return;
    Widget item = internalExpand(elementOrTreePath, false);
    if (item instanceof Item) {
      if (expanded) {
        createChildren(item);
      }
      setExpanded((Item) item, expanded);
View Full Code Here

    List newSelection = new ArrayList(size);
    for (int i = 0; i < size; ++i) {
      Object elementOrTreePath = v.get(i);
      // Use internalExpand since item may not yet be created. See
      // 1G6B1AR.
      Widget w = internalExpand(elementOrTreePath, false);
      if (w instanceof Item) {
        newSelection.add(w);
      } else if (w == null && elementOrTreePath instanceof TreePath) {
        TreePath treePath = (TreePath) elementOrTreePath;
        Object element = treePath.getLastSegment();
View Full Code Here

      return TreeSelection.EMPTY;
    }
    Widget[] items = getSelection(getControl());
    ArrayList list = new ArrayList(items.length);
    for (int i = 0; i < items.length; i++) {
      Widget item = items[i];
      if (item.getData() != null) {
        list.add(getTreePathFromItem((Item) item));
      }
    }
    return new TreeSelection((TreePath[]) list.toArray(new TreePath[list
        .size()]), getComparer());
View Full Code Here

    } else {
      items = internalFindItems(parentElementOrTreePath);
    }

    for (int i = 0; i < items.length; i++) {
      Widget widget = items[i];
      if (widget instanceof Item) {
        Item item = (Item) widget;

        Item[] childItems = getChildren(item);
        if (getExpanded(item)
View Full Code Here

    }
    if (!contentProviderIsLazy) {
      return;
    }
    int index;
    Widget parent = treeItem.getParentItem();
    if (parent == null) {
      parent = treeItem.getParent();
    }
    Object parentElement = parent.getData();
    if (parentElement != null) {
      if (parent instanceof Tree) {
        index = ((Tree) parent).indexOf(treeItem);
      } else {
        index = ((TreeItem) parent).indexOf(treeItem);
View Full Code Here

        ((Tree) widget).clearAll(true);
      } else if (widget instanceof TreeItem) {
        ((TreeItem) widget).clearAll(true);
      }
      int index = 0;
      Widget parent = null;
      if (widget instanceof TreeItem) {
        TreeItem treeItem = (TreeItem) widget;
        parent = treeItem.getParentItem();
        if (parent == null) {
          parent = treeItem.getParent();
View Full Code Here

   *   there is none for the given index
   */
  /* package */ViewerColumn getViewerColumn(final int columnIndex) {

    ViewerColumn viewer;
    Widget columnOwner = getColumnViewerOwner(columnIndex);

    if (columnOwner == null || columnOwner.isDisposed()) {
      return null;
    }

    viewer = (ViewerColumn) columnOwner
        .getData(ViewerColumn.COLUMN_VIEWER_KEY);

    if (viewer == null) {
      viewer = createViewerColumn(columnOwner, CellLabelProvider
          .createViewerLabelProvider(this, getLabelProvider()));
View Full Code Here

        getControl().setRedraw(false);
        // Set the selection at first because in Tree's
        // the element might not be materialized
        setSelection(new StructuredSelection(element), true);

        Widget item = findItem(element);
        if (item != null) {
          ViewerRow row = getViewerRowFromItem(item);
          if (row != null) {
            ViewerCell cell = row.getCell(column);
            if (cell != null) {
View Full Code Here

TOP

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

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.