boolean isElementOrderPreserved() { return viewer.getComparator() == null && viewer.getFilters().length == 0; }
/** * Removes the element from the from whenever it appears as a child of the * specified parent element, at the specified position. * * @param parent * the parent of the element being removed * @param element * the element to remove * @param position * the position where the element is located */ public void remove(Object parent, Object element, int position) { if (treeViewer != null && viewer.getComparator() == null && viewer.getFilters().length == 0) { // Only TreeViewer has a remove-by-index method. treeViewer.remove(parent, position); } else { viewer.remove(parent, new Object[] { element }); } }
protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = getFilteredChildren(parentElementOrTreePath); ViewerComparator comparator = getComparator(); if (parentElementOrTreePath != null && comparator instanceof TreePathViewerSorter) { TreePathViewerSorter tpvs = (TreePathViewerSorter) comparator; // be sure we're not modifying the original array from the model result = (Object[]) result.clone(); TreePath path = null; if (parentElementOrTreePath instanceof TreePath) { path = (TreePath) parentElementOrTreePath; } else { Object parent = parentElementOrTreePath; Widget w = internalGetWidgetToSelect(parent); if (w != null) { path = internalGetSorterParentPath(w, comparator); } } tpvs.sort(this, path, result); } else if (comparator != null) { // be sure we're not modifying the original array from the model result = (Object[]) result.clone(); comparator.sort(this, result); } return result; }
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(parent, comparator);
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(parent, comparator);
@Override protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = getFilteredChildren(parentElementOrTreePath); ViewerComparator comparator = getComparator(); if (parentElementOrTreePath != null && comparator instanceof TreePathViewerSorter) { TreePathViewerSorter tpvs = (TreePathViewerSorter) comparator; // be sure we're not modifying the original array from the model result = result.clone(); TreePath path = null; if (parentElementOrTreePath instanceof TreePath) { path = (TreePath) parentElementOrTreePath; } else { Object parent = parentElementOrTreePath; Widget w = internalGetWidgetToSelect(parent); if (w != null) { path = internalGetSorterParentPath(w, comparator); } } tpvs.sort(this, path, result); } else if (comparator != null) { // be sure we're not modifying the original array from the model result = result.clone(); comparator.sort(this, result); } return result; }
@Override protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = getFilteredChildren(parentElementOrTreePath); ViewerComparator comparator = getComparator(); if (parentElementOrTreePath != null && comparator instanceof TreePathViewerSorter) { TreePathViewerSorter tpvs = (TreePathViewerSorter) comparator; // be sure we're not modifying the original array from the model result = result.clone(); TreePath path = null; if (parentElementOrTreePath instanceof TreePath) { path = (TreePath) parentElementOrTreePath; } else { Object parent = parentElementOrTreePath; Widget w = internalGetWidgetToSelect(parent); if (w != null) { path = internalGetSorterParentPath(w, comparator); } } tpvs.sort(this, path, result); } else if (comparator != null) { // be sure we're not modifying the original array from the model result = result.clone(); comparator.sort(this, result); } return result; }
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(parent, comparator);
if (checkBusy()) return; if (getComparator() != null || hasFilters()) { add(parentElementOrTreePath, new Object[] { element }); return;
if (checkBusy()) return; if (getComparator() != null || hasFilters()) { add(parentElementOrTreePath, new Object[] { element }); return;
if (checkBusy()) return; if (getComparator() != null || hasFilters()) { add(parentElementOrTreePath, new Object[] { element }); return;
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(widget, comparator); Item[] items = getChildren(widget);
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(widget, comparator); Item[] items = getChildren(widget);
ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(widget, comparator); Item[] items = getChildren(widget);
ViewerComparator comparator = getComparator(); if (comparator != null) { if (comparator instanceof TreePathViewerSorter) {
ViewerComparator comparator = getComparator(); if (comparator != null) { if (comparator instanceof TreePathViewerSorter) {
ViewerComparator comparator = getComparator(); if (comparator != null) { if (comparator instanceof TreePathViewerSorter) {