/** * Checks whether this feature is supported for provided IO * @param io IO to check on * @return true if supported */ public static boolean isSupported(InputOutput io) { return find(io) != null; }
/** * With an empty 'extraOps' simply selects this io * without involving it's containing TopComponent. * <p> * For example: * <pre> * if (IOSelect.isSupported(io) { * IOSelect.select(io, EnumSet.noneOf(IOSelect.AdditionalOperation.class)); * } * </pre> * <p> * If this capability is not supported then regular InputOutput.select() * will be called. * @param io InputOutput to operate on. * @param extraOps Additional operations to apply to the containing * TopComponent. */ public static void select(InputOutput io, Set<AdditionalOperation> extraOps) { Parameters.notNull("extraOps", extraOps); // NOI18N IOSelect ios = find(io); if (ios != null) ios.select(extraOps); else io.select(); // fallback }