Search in sources :

Example 6 with Bookmark

use of com.intellij.ide.bookmarks.Bookmark in project intellij-community by JetBrains.

the class BookmarksAction method itemChosen.

@Override
public void itemChosen(ItemWrapper item, Project project, JBPopup popup, boolean withEnterOrDoubleClick) {
    if (item instanceof BookmarkItem && withEnterOrDoubleClick) {
        Bookmark bookmark = ((BookmarkItem) item).getBookmark();
        popup.cancel();
        bookmark.navigate(true);
    }
}
Also used : Bookmark(com.intellij.ide.bookmarks.Bookmark) BookmarkItem(com.intellij.ide.bookmarks.BookmarkItem)

Example 7 with Bookmark

use of com.intellij.ide.bookmarks.Bookmark in project intellij-community by JetBrains.

the class DeleteBookmarkAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    List<Bookmark> bookmarks = BookmarksAction.getSelectedBookmarks(myList);
    ListUtil.removeSelectedItems(myList);
    for (Bookmark bookmark : bookmarks) {
        BookmarkManager.getInstance(myProject).removeBookmark(bookmark);
    }
}
Also used : Bookmark(com.intellij.ide.bookmarks.Bookmark)

Example 8 with Bookmark

use of com.intellij.ide.bookmarks.Bookmark in project intellij-community by JetBrains.

the class AbstractPsiBasedNode method patchIcon.

@Nullable
public static Icon patchIcon(@NotNull Project project, @Nullable Icon original, @Nullable VirtualFile file) {
    if (file == null || original == null)
        return original;
    Icon icon = original;
    final Bookmark bookmarkAtFile = BookmarkManager.getInstance(project).findFileBookmark(file);
    if (bookmarkAtFile != null) {
        final RowIcon composite = new RowIcon(2, RowIcon.Alignment.CENTER);
        composite.setIcon(icon, 0);
        composite.setIcon(bookmarkAtFile.getIcon(), 1);
        icon = composite;
    }
    if (!file.isWritable()) {
        icon = LayeredIcon.create(icon, PlatformIcons.LOCKED_ICON);
    }
    if (file.is(VFileProperty.SYMLINK)) {
        icon = LayeredIcon.create(icon, PlatformIcons.SYMLINK_ICON);
    }
    return icon;
}
Also used : Bookmark(com.intellij.ide.bookmarks.Bookmark) RowIcon(com.intellij.ui.RowIcon) LayeredIcon(com.intellij.ui.LayeredIcon) RowIcon(com.intellij.ui.RowIcon) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Bookmark (com.intellij.ide.bookmarks.Bookmark)8 BookmarkManager (com.intellij.ide.bookmarks.BookmarkManager)3 Project (com.intellij.openapi.project.Project)3 BookmarkItem (com.intellij.ide.bookmarks.BookmarkItem)2 JBPopup (com.intellij.openapi.ui.popup.JBPopup)2 Nullable (org.jetbrains.annotations.Nullable)2 BookmarksListener (com.intellij.ide.bookmarks.BookmarksListener)1 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 FileDocumentManager (com.intellij.openapi.fileEditor.FileDocumentManager)1 DumbAware (com.intellij.openapi.project.DumbAware)1 Comparing (com.intellij.openapi.util.Comparing)1 DimensionService (com.intellij.openapi.util.DimensionService)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 IdeFocusManager (com.intellij.openapi.wm.IdeFocusManager)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 WindowManager (com.intellij.openapi.wm.WindowManager)1 IdeBorderFactory (com.intellij.ui.IdeBorderFactory)1 LayeredIcon (com.intellij.ui.LayeredIcon)1