public void setMedia(final Media media) {
        if (media == null || media.id == mediaId) {
            return;
        }

        setMediaData(media.id, media.type, media.jarFilename(), media.altText, () -> {
            try {
                return Engine.mediaFile(media);
            } catch (IOException ex) {
                return null;
            }
        });

    }
Allows live-editing of a formula, optionally associated with a Variable List
main/src/main/java/cgeo/geocaching/ui/WherigoMediaView.java