@GuiCallback("scroll_bar") public void onProgressChange(Widget w, DraggedEvent event) { VerticalDragBar vdb = VerticalDragBar.get(w); ElementList list = ElementList.get(pageMain.getWidget("area")); list.setProgress((int) (vdb.getProgress() * list.getMaxProgress())); }
private void hierarchyAdd(ElementList list, Widget w) { SingleWidget sw; list.addWidget(sw = new SingleWidget(w)); handlers.put(w, sw); for (Widget ww : w.getDrawList()) { if (!ww.disposed) hierarchyAdd(list, ww); } }
private void init() { pageMain = loaded.getWidget("back").copy(); List<Media> installedMedias = data.getInstalledMediaList(); player.updatePlayerMedias(installedMedias); { Widget area = pageMain.getWidget("area"); ElementList list = new ElementList(); for (Media m : installedMedias) { list.addWidget(createMedia(m)); } area.addComponent(list); } EventLoader.load(pageMain, this); gui.addWidget(pageMain); gui.postEvent(new UpdateMediaEvent()); }