@Override protected Item getChild(Widget widget, int index) { if (widget instanceof TableTreeItem) { return ((TableTreeItem) widget).getItem(index); } if (widget instanceof TableTree) { return ((TableTree) widget).getItem(index); } return null; }
/** * Returns the item at the given point in the receiver * or null if no such item exists. The point is in the * coordinate system of the receiver. * * @param point the point used to locate the item * @return the item at the given point * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public TableTreeItem getItem(Point point) { checkWidget(); TableItem item = table.getItem(point); if (item == null) return null; return getItem(item); } TableTreeItem getItem(TableItem tableItem) {
void onSelection(Event e) { Event event = new Event(); TableItem tableItem = (TableItem)e.item; TableTreeItem item = getItem(tableItem); event.item = item; if (e.type == SWT.Selection && e.detail == SWT.CHECK && item != null) { event.detail = SWT.CHECK; item.checked = tableItem.getChecked(); } notifyListeners(e.type, event); } /**
void onSelection(Event e) { Event event = new Event(); TableItem tableItem = (TableItem)e.item; TableTreeItem item = getItem(tableItem); event.item = item; if (e.type == SWT.Selection && e.detail == SWT.CHECK && item != null) { event.detail = SWT.CHECK; item.checked = tableItem.getChecked(); } notifyListeners(e.type, event); } /**
void onSelection(Event e) { Event event = new Event(); TableItem tableItem = (TableItem)e.item; TableTreeItem item = getItem(tableItem); event.item = item; if (e.type == SWT.Selection && e.detail == SWT.CHECK && item != null) { event.detail = SWT.CHECK; item.checked = tableItem.getChecked(); } notifyListeners(e.type, event); } /**
/** * Returns the item at the given point in the receiver * or null if no such item exists. The point is in the * coordinate system of the receiver. * * @param point the point used to locate the item * @return the item at the given point * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public TableTreeItem getItem(Point point) { checkWidget(); TableItem item = table.getItem(point); if (item == null) return null; return getItem(item); } TableTreeItem getItem(TableItem tableItem) {
/** * Returns the item at the given point in the receiver * or null if no such item exists. The point is in the * coordinate system of the receiver. * * @param point the point used to locate the item * @return the item at the given point * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public TableTreeItem getItem(Point point) { checkWidget(); TableItem item = table.getItem(point); if (item == null) return null; return getItem(item); } TableTreeItem getItem(TableItem tableItem) {
/** * Returns the item at the given point in the receiver * or null if no such item exists. The point is in the * coordinate system of the receiver. * * @param point the point used to locate the item * @return the item at the given point * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public TableTreeItem getItem(Point point) { checkWidget(); TableItem item = table.getItem(point); if (item == null) return null; return getItem(item); } TableTreeItem getItem(TableItem tableItem) {
/** * Returns the item at the given point in the receiver * or null if no such item exists. The point is in the * coordinate system of the receiver. * * @param point the point used to locate the item * @return the item at the given point * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the point is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public TableTreeItem getItem(Point point) { checkWidget(); TableItem item = table.getItem(point); if (item == null) return null; return getItem(item); } TableTreeItem getItem(TableItem tableItem) {
void onSelection(Event e) { Event event = new Event(); TableItem tableItem = (TableItem)e.item; TableTreeItem item = getItem(tableItem); event.item = item; if (e.type == SWT.Selection && e.detail == SWT.CHECK && item != null) { event.detail = SWT.CHECK; item.checked = tableItem.getChecked(); } notifyListeners(e.type, event); } /**
void onSelection(Event e) { Event event = new Event(); TableItem tableItem = (TableItem)e.item; TableTreeItem item = getItem(tableItem); event.item = item; if (e.type == SWT.Selection && e.detail == SWT.CHECK && item != null) { event.detail = SWT.CHECK; item.checked = tableItem.getChecked(); } notifyListeners(e.type, event); } /**
} 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 });
} 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 });
/** * Handle hover. * * @param event the event */ 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 setToolTipText(tt, fd.getDescription()); } else if (o instanceof AllowedValue) { setToolTipText(tt, ((AllowedValue) o).getDescription()); } } else tt.setToolTipText(""); }