/** * Get the currently selected multimedia. * * @param page * @return the first multimedia with selected attribute set. */ public static MultimediaAbstract getSelectedMultimedia(Page page) { for (MultimediaAbstract ma : page.getMultimedia()) { if (ma.getIsSelected()) { return ma; } } return null; }
/** * Since MultimediaAbstract is a model, a View can be attached to it. This allows instant updating * when an attribute changed. */ public static void attachView(Page page, TObserver view) { for (MultimediaAbstract ma : page.getMultimedia()) { ma.addObserver(view); } }
/** * Clears the selection of given page. * * @param page is the Page where mIsSelected attribute is cleared. */ public static void clearMultimediaSelection(Page page) { for (MultimediaAbstract ma : page.getMultimedia()) { ma.setIsSelected(false); } }
public static boolean deleteMultimediaByID(Page page, int multimediID) { return deleteMultimediaByID(page.getMultimedia(), multimediID); }
/** * @param page is where we search for the Multimedia * @param multimediaID * @return Multimedia in <code>page</code> that matches multimediaID */ public static MultimediaAbstract getMultimediaByID(Page page, int multimediaID) { return getMultimediaByID(page.getMultimedia(), multimediaID); }
public static boolean isMultimediaEmpty(Page page) { return page.getMultimedia().isEmpty(); }