ProjectWindowAction (String projectLocation) { if (projectLocation == null) { return null; } final AnAction[] children = getChildren(null); for (AnAction child : children) { if (!(child instanceof ProjectWindowAction windowAction)) { continue; } if (projectLocation.equals(windowAction.getProjectLocation())) { return windowAction; } } return null; }