generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ethauvin/main
Added Scroll to Top/End actions to the console
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/rife/bld/idea/console/BldConsoleActionScrollEnd.java
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,32 @@ | ||
/* | ||
* Copyright 2024 Erik C. Thauvin (https://erik.thauvin.net/)) | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
*/ | ||
package rife.bld.idea.console; | ||
|
||
import com.intellij.icons.AllIcons; | ||
import com.intellij.idea.ActionsBundle; | ||
import com.intellij.openapi.actionSystem.ActionUpdateThread; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.project.DumbAwareAction; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
class BldConsoleActionScrollEnd extends DumbAwareAction { | ||
public BldConsoleActionScrollEnd() { | ||
super(ActionsBundle.message("action.EditorConsoleScrollToTheEnd.text"), null, | ||
AllIcons.RunConfigurations.Scroll_down); | ||
} | ||
|
||
@Override | ||
public @NotNull ActionUpdateThread getActionUpdateThread() { | ||
return ActionUpdateThread.BGT; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(AnActionEvent e) { | ||
var project = e.getProject(); | ||
if (project != null) { | ||
BldConsoleManager.getConsole(project).requestScrollingToEnd(); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/rife/bld/idea/console/BldConsoleActionScrollTop.java
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,32 @@ | ||
/* | ||
* Copyright 2024 Erik C. Thauvin (https://erik.thauvin.net/)) | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
*/ | ||
package rife.bld.idea.console; | ||
|
||
import com.intellij.icons.AllIcons; | ||
import com.intellij.idea.ActionsBundle; | ||
import com.intellij.openapi.actionSystem.ActionUpdateThread; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.project.DumbAwareAction; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
class BldConsoleActionScrollTop extends DumbAwareAction { | ||
public BldConsoleActionScrollTop() { | ||
super(ActionsBundle.message("action.EditorScrollTop.text"), null, | ||
AllIcons.RunConfigurations.Scroll_up); | ||
} | ||
|
||
@Override | ||
public @NotNull ActionUpdateThread getActionUpdateThread() { | ||
return ActionUpdateThread.BGT; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(AnActionEvent e) { | ||
var project = e.getProject(); | ||
if (project != null) { | ||
BldConsoleManager.getConsole(project).scrollTo(0); | ||
} | ||
} | ||
} |
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