Skip to content

Commit

Permalink
Merge pull request #43 from adrienpessu/24-make-the-icons-works
Browse files Browse the repository at this point in the history
add icons to leaf of the tree
  • Loading branch information
adrienpessu authored Jan 8, 2024
2 parents 6e302ac + ecfffee commit 35b8d7c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ data class Leaf(
val githubAlertUrl: String,
) {
override fun toString(): String {
return address

val icon = when (level) {
"error" -> "🛑"
"warning" -> "⚠️"
"note" -> "📝"
else -> ""
}

return "$icon $address"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import com.github.adrienpessu.sarifviewer.models.Leaf
import com.github.adrienpessu.sarifviewer.models.View
import com.github.adrienpessu.sarifviewer.services.SarifService
import com.github.adrienpessu.sarifviewer.utils.GitHubInstance
import com.intellij.icons.AllIcons
import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.components.service
Expand All @@ -24,7 +24,6 @@ import com.intellij.openapi.editor.ScrollType
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.progress.util.ProgressWindow
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.ComboBox
Expand All @@ -33,17 +32,16 @@ import com.intellij.openapi.ui.popup.Balloon
import com.intellij.openapi.ui.popup.JBPopupFactory
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowAnchor
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.ui.ScrollPaneFactory
import com.intellij.ui.awt.RelativePoint
import com.intellij.ui.components.*
import com.intellij.ui.components.JBPanel
import com.intellij.ui.components.JBTabbedPane
import com.intellij.ui.content.ContentFactory
import git4idea.GitLocalBranch
import git4idea.repo.GitRepository
import git4idea.repo.GitRepositoryChangeListener
import git4idea.repo.GitRepositoryManager
import java.awt.BorderLayout
import java.awt.Component
import java.awt.Desktop
import java.awt.Dimension
Expand Down Expand Up @@ -77,10 +75,6 @@ class SarifViewerWindowFactory : ToolWindowFactory {
toolWindow.contentManager.addContent(content)
}

override fun getAnchor(): ToolWindowAnchor? {
return super.getAnchor()
}

override fun shouldBeAvailable(project: Project) = true

class MyToolWindow(toolWindow: ToolWindow) {
Expand Down
10 changes: 0 additions & 10 deletions src/main/kotlin/com/github/adrienpessu/sarifviewer/utils/Icons.kt

This file was deleted.

0 comments on commit 35b8d7c

Please sign in to comment.