@Nullable private static AbstractTreeBuilder getAntTreeBuilder(final AntExplorer antExplorer) { final JTree tree = UIUtil.findComponentOfType(antExplorer, JTree.class); if (tree == null) { LOG.info("Cannot get tree object from AntExplorer"); return null; } final AbstractTreeBuilder antTreeBuilder = AbstractTreeBuilder.getBuilderFor(tree); if (antTreeBuilder == null) { LOG.info("Cannot get Ant tree builder"); return null; } if (antTreeBuilder.isDisposed()) { LOG.info("Ant tree builder is disposed"); return null; } return antTreeBuilder; }
@Nullable private static AntExplorer getAntExplorer(final @NotNull ToolWindow antToolWindow) { final AntExplorer antExplorer = Arrays .stream(antToolWindow.getContentManager().getContents()) .map(content -> { final JComponent component = content.getComponent(); return component instanceof AntExplorer ? (AntExplorer) component : null; }) .filter(Objects::nonNull) .findFirst() .orElse(null); if (antExplorer == null) { LOG.info("Cannot get AntExplorer object"); } return antExplorer; }
public AntBuildFilePropertiesAction(AntExplorer antExplorer) { super(AntBundle.message("build.file.properties.action.name"), AntBundle.message("build.file.properties.action.description"), AntIcons.Properties); myAntExplorer = antExplorer; registerCustomShortcutSet(CommonShortcuts.ALT_ENTER, myAntExplorer); }
@Override public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) { AntExplorer explorer = new AntExplorer(project); final ContentManager contentManager = toolWindow.getContentManager(); final Content content = contentManager.getFactory().createContent(explorer, null, false); contentManager.addContent(content); Disposer.register(project, explorer); }
public AntBuildFilePropertiesAction(AntExplorer antExplorer) { super(AntBundle.message("build.file.properties.action.name"), AntBundle.message("build.file.properties.action.description"), AllIcons.Ant.Properties); myAntExplorer = antExplorer; registerCustomShortcutSet(CommonShortcuts.ALT_ENTER, myAntExplorer); }
@Override public void createToolWindowContent(Project project, ToolWindow toolWindow) { AntExplorer explorer = new AntExplorer(project); final ContentManager contentManager = toolWindow.getContentManager(); final Content content = contentManager.getFactory().createContent(explorer, null, false); contentManager.addContent(content); Disposer.register(project, explorer); }
public AntBuildFilePropertiesAction(AntExplorer antExplorer) { super(AntBundle.message("build.file.properties.action.name"), AntBundle.message("build.file.properties.action.description"), ApacheAntIcons.Properties); myAntExplorer = antExplorer; registerCustomShortcutSet(CommonShortcuts.ALT_ENTER, myAntExplorer); }
public RemoveBuildFileAction(AntExplorer antExplorer) { super(AntBundle.message("remove.build.file.action.name")); myAntExplorer = antExplorer; }