/** * Removes the ScuflModelEventListener from the internal ScuflModel */ public void removeInternalModelEventListener() { theInternalModel.removeListener(eventListener); }
public void modelRemoved(ScuflModel workflow) { ChangedModelListener listener = listeners.get(workflow); if (listener != null) { workflow.removeListener(listener); } listeners.remove(workflow); filenames.remove(workflow); } }
/** * Unregister as listener with known ScuflModels. */ private void reset() { // Remove existing listeners for (Entry<ScuflModel, ChangedModelListener> entry : listeners.entrySet()) { entry.getKey().removeListener(entry.getValue()); } listeners.clear(); filenames.clear(); changedWorkflows.clear(); }
public void modelDestroyed(String modelName, Object oldModel) { setWorkflow(null); ScuflModel oldWorkflow = (ScuflModel) oldModel; oldWorkflow.removeListener(listener); } }
public void detachFromModel() { if (scuflModel != null) { scuflModel.removeListener(eventListener); tree.detachFromModel(); this.scuflModel = null; } }
public void detachFromModel() { setVisible(false); if (model == null) { return; } model.removeListener(this); model = null; }
public void detachFromModel() { processor.getModel().removeListener(this); }
public void detachFromModel() { processor.getModel().removeListener(this); }
public void detachFromModel() { processor.getModel().removeListener(this); }
/** * */ public synchronized void detachFromModel() { if (model != null) { model.getModel().removeListener(this); model = null; } synchronized (reconciler) { reconciler.notify(); } } }
public void modelChanged(String modelName, Object oldModel, Object newModel) { ScuflModel oldWorkflow = (ScuflModel) oldModel; ScuflModel newWorkflow = (ScuflModel) newModel; oldWorkflow.removeListener(listener); newWorkflow.addListener(listener); setWorkflow(newWorkflow); }
public void testNotifyThread() { ScuflModel model = new ScuflModel(); assertNull("notify thread should be null",model.notifyThread); ScuflModelEventListener listener = new ScuflModelEventListener() { public void receiveModelEvent(ScuflModelEvent event) { } }; model.addListener(listener); assertNotNull("notify thread should not be null",model.notifyThread); model.removeListener(listener); assertNull("notify thread should be null",model.notifyThread); }
public void testListener() { ScuflModel model = new ScuflModel(); for (ScuflModelEventListener listener : model.getListeners() ) { assertFalse(listener instanceof XScuflView); } // Should add it self automatically XScuflView view = new XScuflView(model); for (ScuflModelEventListener listener : model.getListeners() ) { assertTrue(listener instanceof XScuflView); } // But we have to remove it manually model.removeListener(view); for (ScuflModelEventListener listener : model.getListeners() ) { assertFalse(listener instanceof XScuflView); } } }