Skip to content

Commit 12ddbbb

Browse files
committed
Changed log tab message
TODO: - Unsafe fallback option - Better file watcher (create events, watch the whole local repo) - Check how exceptions are handled while in checkers - Store matched stacktrace with the exception for highlighting
1 parent f3deb4b commit 12ddbbb

File tree

1 file changed

+45
-42
lines changed

1 file changed

+45
-42
lines changed

src/main/kotlin/com/github/mr3zee/kotlinPlugins/KotlinPluginsToolWindowFactory.kt

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class KotlinPluginsToolWindowFactory : ToolWindowFactory, DumbAware {
126126
tree.overviewPanel = overviewPanel
127127
val tabs = JBTabbedPane()
128128
tabs.addTab("Overview", overviewPanel.overviewPanelComponent)
129-
tabs.addTab("Logs", createPanel("Logs tab is empty"))
129+
tabs.addTab("Logs", createLogPanel())
130130
splitter.secondComponent = tabs
131131

132132
// Tree selection -> state + overview refresh
@@ -153,10 +153,13 @@ class KotlinPluginsToolWindowFactory : ToolWindowFactory, DumbAware {
153153
contentManager.addContent(content)
154154
}
155155

156-
private fun createPanel(content: String): JPanel {
156+
private fun createLogPanel(): JPanel {
157157
return JPanel().apply {
158-
layout = BorderLayout()
159-
add(JBLabel(content), BorderLayout.CENTER)
158+
layout = GridBagLayout()
159+
160+
val logNotice = GrayedLabel("Logs tab is WIP.")
161+
162+
vertical(logNotice)
160163
}
161164
}
162165

@@ -555,11 +558,6 @@ internal class OverviewPanel(
555558
foreground = JBUI.CurrentTheme.Label.disabledForeground()
556559
}
557560

558-
@Suppress("FunctionName")
559-
private fun GrayedLabel(@NlsContexts.Label text: String) = JBLabel(text).apply {
560-
foreground = JBUI.CurrentTheme.Label.disabledForeground()
561-
}
562-
563561
private fun JLabel.align(alignment: Int): JLabel {
564562
horizontalAlignment = alignment
565563
return this
@@ -683,39 +681,6 @@ internal class OverviewPanel(
683681
}
684682
}
685683

686-
private fun JPanel.vertical(
687-
vararg components: JComponent,
688-
) {
689-
val gbc = GridBagConstraints()
690-
691-
components.forEachIndexed { i, component ->
692-
gbc.gridx = 0 // Column 0
693-
gbc.gridy = i // Row i
694-
if (i != components.lastIndex) {
695-
gbc.insets.bottom = 7
696-
}
697-
this.add(component, gbc)
698-
}
699-
}
700-
701-
@Suppress("unused")
702-
private fun JPanel.horizontal(
703-
vararg components: JComponent,
704-
@Suppress("SameParameterValue")
705-
rightInset: Int = 5,
706-
) {
707-
val gbc = GridBagConstraints()
708-
709-
components.forEachIndexed { i, component ->
710-
gbc.gridx = i // Column i
711-
gbc.gridy = 0 // Row 0
712-
if (i != components.lastIndex) {
713-
gbc.insets.right = rightInset
714-
}
715-
this.add(component, gbc)
716-
}
717-
}
718-
719684
private fun loadFqNamesAsync(jarId: JarId, onReady: (Set<String>) -> Unit) {
720685
val analyzer = project.service<KotlinPluginsExceptionAnalyzerService>()
721686
if (!analyzer.state.enabled) {
@@ -1673,6 +1638,44 @@ private fun <T> Row.jbList(
16731638
return list
16741639
}
16751640

1641+
@Suppress("FunctionName")
1642+
private fun GrayedLabel(@NlsContexts.Label text: String) = JBLabel(text).apply {
1643+
foreground = JBUI.CurrentTheme.Label.disabledForeground()
1644+
}
1645+
1646+
private fun JPanel.vertical(
1647+
vararg components: JComponent,
1648+
) {
1649+
val gbc = GridBagConstraints()
1650+
1651+
components.forEachIndexed { i, component ->
1652+
gbc.gridx = 0 // Column 0
1653+
gbc.gridy = i // Row i
1654+
if (i != components.lastIndex) {
1655+
gbc.insets.bottom = 7
1656+
}
1657+
this.add(component, gbc)
1658+
}
1659+
}
1660+
1661+
@Suppress("unused")
1662+
private fun JPanel.horizontal(
1663+
vararg components: JComponent,
1664+
@Suppress("SameParameterValue")
1665+
rightInset: Int = 5,
1666+
) {
1667+
val gbc = GridBagConstraints()
1668+
1669+
components.forEachIndexed { i, component ->
1670+
gbc.gridx = i // Column i
1671+
gbc.gridy = 0 // Row 0
1672+
if (i != components.lastIndex) {
1673+
gbc.insets.right = rightInset
1674+
}
1675+
this.add(component, gbc)
1676+
}
1677+
}
1678+
16761679
private val MonospacedFont by lazy {
16771680
val attributes = mutableMapOf<TextAttribute, Any?>()
16781681

0 commit comments

Comments
 (0)