Skip to content

Commit

Permalink
Disable the Clear/Top/End icons if the console is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Jul 30, 2024
1 parent a86f5f6 commit 8633590
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ public void actionPerformed(AnActionEvent e) {
}
}

@Override
public void update(AnActionEvent event) {
var project = event.getProject();
if (project != null) {
var presentation = event.getPresentation();
presentation.setEnabled(BldConsoleManager.getConsole(project).getContentSize() != 0);
}
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public BldConsoleActionScrollEnd() {
return ActionUpdateThread.BGT;
}

@Override
public void update(AnActionEvent event) {
var project = event.getProject();
if (project != null) {
var presentation = event.getPresentation();
presentation.setEnabled(BldConsoleManager.getConsole(project).getContentSize() != 0);
}
}

@Override
public void actionPerformed(AnActionEvent e) {
var project = e.getProject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public BldConsoleActionScrollTop() {
return ActionUpdateThread.BGT;
}

@Override
public void update(AnActionEvent event) {
var project = event.getProject();
if (project != null) {
var presentation = event.getPresentation();
presentation.setEnabled(BldConsoleManager.getConsole(project).getContentSize() != 0);
}
}

@Override
public void actionPerformed(AnActionEvent e) {
var project = e.getProject();
Expand Down

0 comments on commit 8633590

Please sign in to comment.