Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Item


     * @param widget the widget
     */
    private void internalCollectChecked(List result, Widget widget) {
        Item[] items = getChildren(widget);
        for (int i = 0; i < items.length; i++) {
            Item item = items[i];
            if (item instanceof TreeItem && ((TreeItem) item).getChecked()) {
                Object data = item.getData();
                if (data != null) {
          result.add(data);
        }
            }
            internalCollectChecked(result, item);
View Full Code Here


     * @param widget the widget
     */
    private void internalCollectGrayed(List result, Widget widget) {
        Item[] items = getChildren(widget);
        for (int i = 0; i < items.length; i++) {
            Item item = items[i];
            if (item instanceof TreeItem && ((TreeItem) item).getGrayed()) {
                Object data = item.getData();
                if (data != null) {
          result.add(data);
        }
            }
            internalCollectGrayed(result, item);
View Full Code Here

    private void setCheckedChildren(Item item, boolean state) {
        createChildren(item);
        Item[] items = getChildren(item);
        if (items != null) {
            for (int i = 0; i < items.length; i++) {
                Item it = items[i];
                if (it.getData() != null && (it instanceof TreeItem)) {
                    TreeItem treeItem = (TreeItem) it;
                    treeItem.setChecked(state);
                    setCheckedChildren(treeItem, state);
                }
            }
View Full Code Here

      }
      return (result != null) ? result : ""; //$NON-NLS-1$
    }

    public void modify(Object element, String property, Object value) {
      Item item = (Item) element;
      String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
      String newValue = value.toString();
      if ((newValue != null) && !newValue.equals(oldValue)) {
        treeContentHelper.setNodeValue((Node) item.getData(), value.toString(), getControl().getShell());
      }
    }
View Full Code Here

      return (result != null) ? result : ""; //$NON-NLS-1$
    }

    public void modify(Object element, String property, Object value) {
      // enableNodeSelectionListener(false);
      Item item = (Item) element;
      String oldValue = treeContentHelper.getNodeValue((Node) item.getData());
      String newValue = value.toString();
      if ((newValue != null) && !newValue.equals(oldValue)) {
        treeContentHelper.setNodeValue((Node) item.getData(), value.toString());
      }
      // enableNodeSelectionListener(true);
    }
View Full Code Here

        Object attribute = ((SimpleFeature)element).getAttribute(property);
        return attribute;
    }

    public void modify( Object element, String property, Object value ) {
        Item item=(Item) element;
        SimpleFeature feature=(SimpleFeature) item.getData();
        Object oldValue=feature.getAttribute(property);
        if( oldValue==null ){
            if( value==null )
                return;
            else
View Full Code Here

      public void propertyChanged(Object source, int propertyId) {
        MultiPageEditorPart.this.handlePropertyChange(propertyId);
      }
    });
    // create item for page only after createPartControl has succeeded
    Item item = createItem(index, parent2);
    // remember the editor, as both data on the item, and in the list of
    // editors (see field comment)
    item.setData(editor);
    nestedEditors.add(editor);
  }
View Full Code Here

   * @return the editor for the specified page, or <code>null</code> if the
   *         specified page was not created with
   *         <code>addPage(IEditorPart,IEditorInput)</code>
   */
  protected IEditorPart getEditor(int pageIndex) {
    Item item = getItem(pageIndex);
    if (item != null) {
      Object data = item.getData();
      if (data instanceof IEditorPart) {
        return (IEditorPart) data;
      }
    }
    return null;
View Full Code Here

    });
    ViewerDropAdapter dropAdapter = new ViewerDropAdapter(m_viewer) {
      @Override
      protected int determineLocation(DropTargetEvent event) {
        if (event.item instanceof Item) {
          Item item = (Item) event.item;
          Point coordinates = m_viewer.getControl().toControl(event.x, event.y);
          Rectangle bounds = getBounds(item);
          // when drag device, relation with category can be only ON
          if (!m_dragCategory && determineTarget(event) instanceof CategoryInfo) {
            return LOCATION_ON;
View Full Code Here

    @Override
    protected int determineLocation( DropTargetEvent event ) {
        if (!(event.item instanceof Item)) {
            return LOCATION_NONE;
        }
        Item item = (Item) event.item;
        Point coordinates = new Point(event.x, event.y);
        coordinates = getViewer().getControl().toControl(coordinates);
        if (item != null) {
            Rectangle bounds = getBounds(item);
            if (bounds == null) {
View Full Code Here

TOP

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

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.