/** * Removes the listener for the auto save mechanism if it is currently * active. */ private void removeAutoSaveListener() { if (autoSaveListener != null) { removeEventListener(ConfigurationEvent.ANY, autoSaveListener); autoSaveListener.updateFileHandler(null); autoSaveListener = null; } }
/** * Installs the listener for the auto save mechanism if it is not yet * active. */ private void installAutoSaveListener() { if (autoSaveListener == null) { autoSaveListener = new AutoSaveListener(this); addEventListener(ConfigurationEvent.ANY, autoSaveListener); autoSaveListener.updateFileHandler(getFileHandler()); } }
/** * {@inheritDoc} This implementation deals with the creation and * initialization of a {@code FileHandler} associated with the new result * object. */ @Override protected void initResultInstance(final T obj) throws ConfigurationException { super.initResultInstance(obj); final FileHandler srcHandler = (currentFileHandler != null && !resetParameters) ? currentFileHandler : fetchFileHandlerFromParameters(); currentFileHandler = new FileHandler(obj, srcHandler); if (autoSaveListener != null) { autoSaveListener.updateFileHandler(currentFileHandler); } initFileHandler(currentFileHandler); resetParameters = false; }