generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
137 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
plugin/src/main/kotlin/ch/kleis/lcaac/plugin/actions/tasks/TaskLogger.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package ch.kleis.lcaac.plugin.actions.tasks | ||
|
||
import com.intellij.execution.ui.ConsoleViewContentType | ||
import com.intellij.notification.NotificationGroupManager | ||
import com.intellij.notification.NotificationType | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.terminal.TerminalExecutionConsole | ||
|
||
interface TaskLogger { | ||
fun info(title: String, text: String) | ||
fun error(title: String, text: String) | ||
} | ||
|
||
class TerminalTaskLogger(private val term: TerminalExecutionConsole) : TaskLogger { | ||
override fun info(title: String, html: String) { | ||
val text = html.replace("<br>", "\n ") | ||
term.print("$title: $text\n", ConsoleViewContentType.LOG_INFO_OUTPUT) | ||
} | ||
|
||
override fun error(title: String, text: String) { | ||
term.print("$title: $text\n", ConsoleViewContentType.LOG_ERROR_OUTPUT) | ||
} | ||
} | ||
|
||
class EventTaskLogger(private val project: Project) : TaskLogger { | ||
override fun info(title: String, text: String) { | ||
NotificationGroupManager.getInstance() | ||
.getNotificationGroup("LcaAsCode") | ||
.createNotification(title, text, NotificationType.INFORMATION) | ||
.notify(project) | ||
} | ||
|
||
override fun error(title: String, text: String) { | ||
NotificationGroupManager.getInstance() | ||
.getNotificationGroup("LcaAsCode") | ||
.createNotification(title, text, NotificationType.ERROR) | ||
.notify(project) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
plugin/src/main/kotlin/ch/kleis/lcaac/plugin/ui/toolwindow/LcaRunToolWindowFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ch.kleis.lcaac.plugin.ui.toolwindow | ||
|
||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.wm.ToolWindow | ||
import com.intellij.openapi.wm.ToolWindowFactory | ||
|
||
class LcaRunToolWindowFactory : ToolWindowFactory { | ||
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters