AntBuildFile (final String id) { for (AntBuildFile buildFile : myBuildFiles) { AntBuildModelBase model = (AntBuildModelBase)buildFile.getModel(); if (id.equals(model.getDefaultTargetActionId())) { return buildFile; } if (model.hasTargetWithActionId(id)) return buildFile; } return null; }