diff --git a/src/main/java/indi/bookmarkx/ui/tree/BmkTreeCellRenderer.java b/src/main/java/indi/bookmarkx/ui/tree/BmkTreeCellRenderer.java index b66a07d..4f3bdf3 100644 --- a/src/main/java/indi/bookmarkx/ui/tree/BmkTreeCellRenderer.java +++ b/src/main/java/indi/bookmarkx/ui/tree/BmkTreeCellRenderer.java @@ -5,6 +5,7 @@ import com.intellij.openapi.util.IconLoader; import com.intellij.util.ui.UIUtil; import indi.bookmarkx.common.BaseColors; +import indi.bookmarkx.model.BookmarkNodeModel; import javax.swing.Icon; import javax.swing.JTree; @@ -48,6 +49,12 @@ public Component getTreeCellRendererComponent(JTree tree, icon = node.isBookmark() ? IconLoader.findIcon("icons/bookmark.svg") : AllIcons.Nodes.Folder; + if (node.isBookmark()) { + BookmarkNodeModel model = (BookmarkNodeModel) node.getUserObject(); + if (null == model.getOpenFileDescriptor()) { + icon = IconLoader.findIcon("icons/dissmiss.svg"); + } + } } setIcon(icon); return this; diff --git a/src/main/java/indi/bookmarkx/ui/tree/BookmarkTree.java b/src/main/java/indi/bookmarkx/ui/tree/BookmarkTree.java index a6b32ad..1f92a23 100644 --- a/src/main/java/indi/bookmarkx/ui/tree/BookmarkTree.java +++ b/src/main/java/indi/bookmarkx/ui/tree/BookmarkTree.java @@ -197,6 +197,9 @@ public void mouseClicked(MouseEvent e) { BookmarkNodeModel bookmark = (BookmarkNodeModel) selectedNode.getUserObject(); OpenFileDescriptor fileDescriptor = bookmark.getOpenFileDescriptor(); + if (null == fileDescriptor) { + return; + } fileDescriptor.navigate(true); } } diff --git a/src/main/resources/icons/dissmiss.svg b/src/main/resources/icons/dissmiss.svg new file mode 100644 index 0000000..c2c14cf --- /dev/null +++ b/src/main/resources/icons/dissmiss.svg @@ -0,0 +1,7 @@ + + + + \ No newline at end of file