public boolean equals(Object o) { if (o instanceof StructureViewTreeElementWrapper) { return Comparing.equal( unwrapValue(getValue()), unwrapValue(((StructureViewTreeElementWrapper) o).getValue())); } else if (o instanceof StructureViewTreeElement) { return Comparing.equal(unwrapValue(getValue()), ((StructureViewTreeElement) o).getValue()); } return false; }
private static boolean addToPath( AbstractTreeNode<?> rootElement, Object element, ArrayList<AbstractTreeNode> result, Collection<Object> processedElements) { Object value = rootElement.getValue(); if (value instanceof StructureViewTreeElement) { value = ((StructureViewTreeElement) value).getValue(); } if (!processedElements.add(value)) { return false; } if (Comparing.equal(value, element)) { result.add(0, rootElement); return true; } Collection<? extends AbstractTreeNode> children = rootElement.getChildren(); for (AbstractTreeNode child : children) { if (addToPath(child, element, result, processedElements)) { result.add(0, rootElement); return true; } } return false; }
public void refreshPresentation() { // 1. vertical 2. number of lines 3. soft wraps (4. ignore spaces) PresentationState current = new PresentationState(); if (myFragmentedContent != null && !Comparing.equal(myPresentationState, current)) { myFragmentedContent.recalculate(); refreshData(myFragmentedContent); } myPreviousDiff.registerCustomShortcutSet(myPreviousDiff.getShortcutSet(), myParent); myNextDiff.registerCustomShortcutSet(myNextDiff.getShortcutSet(), myParent); }