use of org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel in project checkstyle-idea by jshiell.
the class ScrollToSource method isSelected.
@Override
public boolean isSelected(final AnActionEvent event) {
final Project project = DataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
return false;
}
final CheckStylePlugin checkStylePlugin = project.getComponent(CheckStylePlugin.class);
if (checkStylePlugin == null) {
throw new IllegalStateException("Couldn't get checkstyle plugin");
}
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(CheckStyleToolWindowPanel.ID_TOOLWINDOW);
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null && content.getComponent() instanceof CheckStyleToolWindowPanel) {
return ((CheckStyleToolWindowPanel) content.getComponent()).isScrollToSource();
}
return false;
}
use of org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel in project checkstyle-idea by jshiell.
the class BaseAction method setProgressText.
protected void setProgressText(final ToolWindow toolWindow, final String progressTextKey) {
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null) {
final JComponent component = content.getComponent();
// the content instance will be a JLabel while the component initialises
if (component instanceof CheckStyleToolWindowPanel) {
final CheckStyleToolWindowPanel panel = (CheckStyleToolWindowPanel) component;
panel.setProgressText(CheckStyleBundle.message(progressTextKey));
}
}
}
use of org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel in project checkstyle-idea by jshiell.
the class CollapseAll method actionPerformed.
@Override
public void actionPerformed(final AnActionEvent event) {
final Project project = DataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
return;
}
final CheckStylePlugin checkStylePlugin = project.getComponent(CheckStylePlugin.class);
if (checkStylePlugin == null) {
throw new IllegalStateException("Couldn't get checkstyle plugin");
}
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(CheckStyleToolWindowPanel.ID_TOOLWINDOW);
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null && content.getComponent() instanceof CheckStyleToolWindowPanel) {
((CheckStyleToolWindowPanel) content.getComponent()).collapseTree();
}
}
use of org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel in project checkstyle-idea by jshiell.
the class DisplayErrors method setSelected.
@Override
public void setSelected(final AnActionEvent event, final boolean selected) {
final Project project = DataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
return;
}
final CheckStylePlugin checkStylePlugin = project.getComponent(CheckStylePlugin.class);
if (checkStylePlugin == null) {
throw new IllegalStateException("Couldn't get checkstyle plugin");
}
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(CheckStyleToolWindowPanel.ID_TOOLWINDOW);
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null && content.getComponent() instanceof CheckStyleToolWindowPanel) {
final CheckStyleToolWindowPanel panel = (CheckStyleToolWindowPanel) content.getComponent();
panel.setDisplayingErrors(selected);
panel.filterDisplayedResults();
}
}
use of org.infernus.idea.checkstyle.toolwindow.CheckStyleToolWindowPanel in project checkstyle-idea by jshiell.
the class DisplayInfo method isSelected.
@Override
public boolean isSelected(final AnActionEvent event) {
final Project project = DataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
return false;
}
final CheckStylePlugin checkStylePlugin = project.getComponent(CheckStylePlugin.class);
if (checkStylePlugin == null) {
throw new IllegalStateException("Couldn't get checkstyle plugin");
}
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(CheckStyleToolWindowPanel.ID_TOOLWINDOW);
final Content content = toolWindow.getContentManager().getContent(0);
if (content != null && content.getComponent() instanceof CheckStyleToolWindowPanel) {
return ((CheckStyleToolWindowPanel) content.getComponent()).isDisplayingInfo();
}
return false;
}
Aggregations