Skip to content

Commit

Permalink
cleanup: add @OverRide to PsiViewerTreeModel
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmedvedev authored and hurricup committed Dec 22, 2023
1 parent 1f87b8d commit 5638775
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public PsiViewerTreeModel(PsiViewerProjectService projectComponent) {
myPsiViewerProjectService = projectComponent;
}

@Override
public Object getRoot() {
return myRootElement;
}
Expand All @@ -48,17 +49,20 @@ public void setRoot(PsiElement root) {
myRootElement = root;
}

@Override
public Object getChild(Object parent, int index) {
PsiElement psi = (PsiElement) parent;
List<PsiElement> children = getFilteredChildren(psi);
return children.get(index);
}

@Override
public int getChildCount(Object parent) {
PsiElement psi = (PsiElement) parent;
return getFilteredChildren(psi).size();
}

@Override
public boolean isLeaf(Object node) {
PsiElement psi = (PsiElement) node;
return getFilteredChildren(psi).isEmpty();
Expand All @@ -79,6 +83,7 @@ private boolean isValid(PsiElement psiElement) {
return !myPsiViewerProjectService.isFilterWhitespace() || !(psiElement instanceof PsiWhiteSpace);
}

@Override
public int getIndexOfChild(Object parent, Object child) {
if (!(child instanceof PsiElement)) return -1;
PsiElement psiParent = (PsiElement) parent;
Expand All @@ -87,12 +92,15 @@ public int getIndexOfChild(Object parent, Object child) {
return psiChildren.indexOf(child);
}

@Override
public void valueForPathChanged(TreePath path, Object newValue) {
}

@Override
public synchronized void addTreeModelListener(TreeModelListener l) {
}

@Override
public synchronized void removeTreeModelListener(TreeModelListener l) {
}
}

0 comments on commit 5638775

Please # to comment.