Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.TableTreeItem


    enable();
  }

  public void handleHover(Event event) {
    // next getItem call requires that table have SWT.FULL_SELECTION Style
    TableTreeItem item = tt.getItem(new Point(event.x, event.y));
    if (null != item) {
      Object o = item.getData();
      if (null == o)
        throw new InternalErrorCDE("invalid state");

      if (o instanceof TypeDescription) {
        setToolTipText(tt, ((TypeDescription) o).getDescription());
      } else if (o instanceof FeatureDescription) {
        FeatureDescription fd = (FeatureDescription) o;
        if (item.getBounds(MULTIPLE_REF_OK_COL).contains(event.x, event.y)
                && isArrayOrListType(fd.getRangeTypeName())) {
          Boolean mra = fd.getMultipleReferencesAllowed();
          setToolTipText(tt, (mra != null && mra.booleanValue()) ? "Multiple References Allowed"
                  : "Multiple References Not Allowed");
        } else
View Full Code Here


    // update the GUI
    if (refreshNeeded)
      refresh();
    else {
      TableTreeItem item = new TableTreeItem(parent, SWT.NONE);
      item.setText(NAME_COL, HEADER_ALLOWED_VALUE);
      item.setText(AV_COL, convertNull(av.getString()));
      item.setData(av);

      parent.setExpanded(true);
    }

    editor.addDirtyTypeName(td.getName());
View Full Code Here

      finishAction();
    } else {
      fd = td.addFeature(null, null, null);
      featureUpdate(fd, dialog);
      TableTreeItem item = new TableTreeItem(parent, SWT.NONE);
      updateGuiFeature(item, fd, td);
      parent.setExpanded(true);
      finishActionPack();
    }
  }
View Full Code Here

    }
    setFileDirty();
  }

  private void handleEdit() {
    TableTreeItem item = tt.getSelection()[0];
    TableTreeItem parentType = item.getParentItem();

    if (null == parentType) { // editing a type, not a feature
      editType(item);
    } else if (item.getText(NAME_COL).equals(HEADER_ALLOWED_VALUE)) {
      editAllowedValue(item, parentType);
View Full Code Here

  /*
   * Note that the Remove action is disabled if the item selected is imported only
   */
  private void handleRemove() {
    TableTreeItem item = tt.getSelection()[0];
    TableTreeItem parent = item.getParentItem();

    if (null == parent)
      handleRemoveType(item);
    else if (item.getText(NAME_COL).equals(HEADER_ALLOWED_VALUE))
      handleRemoveAllowedValue(item);
View Full Code Here

    if (prov instanceof ITableLabelProvider) {
      tprov = (ITableLabelProvider) prov;
    }

    int columnCount = tableTree.getTable().getColumnCount();
    TableTreeItem ti = (TableTreeItem) item;
    // Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
    // TableViewer with 0 columns does not work
    for (int column = 0; column < columnCount || column == 0; column++) {
      String text = "";//$NON-NLS-1$
      Image image = null;
      if (tprov != null) {
        text = tprov.getColumnText(element, column);
        image = tprov.getColumnImage(element, column);
      } else {
        if (column == 0) {
          ViewerLabel updateLabel = new ViewerLabel(item.getText(),
              item.getImage());
          buildLabel(updateLabel, element);

          // As it is possible for user code to run the event
          // loop check here.
          if (item.isDisposed()) {
            unmapElement(element, item);
            return;
          }

          text = updateLabel.getText();
          image = updateLabel.getImage();
        }
      }

      // Avoid setting text to null
      if (text == null) {
        text = ""; //$NON-NLS-1$
      }

      ti.setText(column, text);
      // Apparently a problem to setImage to null if already null
      if (ti.getImage(column) != image) {
        ti.setImage(column, image);
      }

      getColorAndFontCollector().setFontsAndColors(element);
      getColorAndFontCollector().applyFontsAndColors(ti);
    }
View Full Code Here

   *         index is out of range
   */
  public Object getElementAt(int index) {
    // XXX: Workaround for 1GBCSB1: SWT:WIN2000 - TableTree should have
    // getItem(int index)
    TableTreeItem i = tableTree.getItems()[index];
    if (i != null) {
      return i.getData();
    }
    return null;
  }
View Full Code Here

  /*
   * (non-Javadoc) Method declared in AbstractTreeViewer.
   */
  protected Item newItem(Widget parent, int flags, int ix) {
    TableTreeItem item;
    if (ix >= 0) {
      if (parent instanceof TableTreeItem) {
        item = new TableTreeItem((TableTreeItem) parent, flags, ix);
      } else {
        item = new TableTreeItem((TableTree) parent, flags, ix);
      }
    } else {
      if (parent instanceof TableTreeItem) {
        item = new TableTreeItem((TableTreeItem) parent, flags);
      } else {
        item = new TableTreeItem((TableTree) parent, flags);
      }
    }
    return item;
  }
View Full Code Here

      return item.getParent();
    } else if (widget instanceof TableItem) {
      TableItem item = (TableItem) widget;
      return item.getParent();
    } else if (widget instanceof TableTreeItem) {
      TableTreeItem item = (TableTreeItem) widget;
      return item.getParent();
    } else if (widget instanceof ToolItem) {
      ToolItem item = (ToolItem) widget;
      return item.getParent();
    } else if (widget instanceof TreeColumn) {
      TreeColumn item = (TreeColumn) widget;
      return item.getParent();
    } else if (widget instanceof TreeItem) {
      TreeItem item = (TreeItem) widget;
      return item.getParent();
    } else if (widget instanceof Caret) {
      Caret item = (Caret) widget;
      return item.getParent();
    }
    return null;
  }
View Full Code Here

            table.setSelection(new TableItem[] { item });
          }
                    selEvent.item = item;
                } else if (w instanceof TableTree) {
                    TableTree table = (TableTree) w;
                    TableTreeItem item = table.getItem(new Point(e.x, e.y));
                    if (item != null) {
            table.setSelection(new TableTreeItem[] { item });
          }
                    selEvent.item = item;
                } else {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.TableTreeItem

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.