request.setUndoable(true);
request.addChangeListener(new ChangeListener() {
public void changeFailed(ChangeRequest change,
Exception exception) {
// If we fail, then issue structureChanged.
dispatchGraphEvent(new GraphEvent(eventSource,
GraphEvent.STRUCTURE_CHANGED, getRoot()));
}
public void changeExecuted(ChangeRequest change) {
// If we succeed, then issue structureChanged, since
// this is likely connected to something.
dispatchGraphEvent(new GraphEvent(eventSource,
GraphEvent.STRUCTURE_CHANGED, getRoot()));
}
});
request.setUndoable(true);
container.requestChange(request);