protected void unbindList() { if (boundToList != null) { Scripts.unlisten(boundToList); boundToList = null; } }
protected void unbindCursor() { if (boundToCursor != null) { Scripts.unlisten(boundToCursor); boundToCursor = null; } }
protected void unbind() { if (boundToData != null) { Scripts.unlisten(boundToData); boundToData = null; } rowsModel.setData(null); }
protected void unbind() { boolean wasBoundToData = boundToData != null; if (boundToData != null) { Scripts.unlisten(boundToData); boundToData = null; } if (boundToValue != null) { removeValueChangeListener(boundToValue); boundToValue = null; } if (wasBoundToData) { setValue(null); } }
protected void enqueueElementsChanged() { if (boundToDataElements != null) { Scripts.unlisten(boundToDataElements); boundToDataElements = null; } elementsChangedEnqueued = () -> { if (elementsChangedEnqueued == this) { elementsChangedEnqueued = null; if (data != null && Scripts.isInitialized()) { boundToDataElements = Scripts.getSpace().listenElements(data, new AbstractJSObject() { @Override public Object call(Object thiz, Object... args) { enqueueElementsDataChanged(); return null; } }); } fireElementsChanged(); } }; EventQueue.invokeLater(elementsChangedEnqueued); }
protected void resignOnCursor() { if (cursorListener != null) { cursorListener.remove(); cursorListener = null; } if (published != null && published.getMember(CURSOR_PROP_NAME) instanceof JSObject) { JSObject jsCursor = (JSObject) published.getMember(CURSOR_PROP_NAME); JSObject jsReg = Scripts.getSpace().listen(jsCursor, "", new AbstractJSObject() { @Override public boolean isFunction() { return true; } @Override public Object call(Object thiz, Object... args) { try { internalExecuteChildren(false); } catch (Exception ex) { Logger.getLogger(ApplicationEntity.class.getName()).log(Level.SEVERE, null, ex); } return null; } }); cursorListener = () -> { Scripts.unlisten(jsReg); }; } } protected static final String CURSOR_PROP_NAME = "cursor";