Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-11-05 01:27:42 +0000
committerChristian W. Damus2013-11-05 01:27:42 +0000
commit17fc6eff3ec7bd8acdbd0863f0671cde078c272d (patch)
tree6e779850da9a92d6338c9458687be89d1869fa00 /plugins/org.eclipse.emf.cdo.security.ui
parent55c573a055f5e7a173ffbe0a6e04183af9605020 (diff)
downloadcdo-17fc6eff3ec7bd8acdbd0863f0671cde078c272d.tar.gz
cdo-17fc6eff3ec7bd8acdbd0863f0671cde078c272d.tar.xz
cdo-17fc6eff3ec7bd8acdbd0863f0671cde078c272d.zip
[418452] [Security] Simplified security model editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=418452 Fix widget-disposed exceptions from the Security Manager after it has been closed when continuing to edit the security realm in the advanced (tree) editor.
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.security.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.security.ui/src/org/eclipse/emf/cdo/security/internal/ui/editor/CDOSecurityFormEditor.java32
1 files changed, 28 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.security.ui/src/org/eclipse/emf/cdo/security/internal/ui/editor/CDOSecurityFormEditor.java b/plugins/org.eclipse.emf.cdo.security.ui/src/org/eclipse/emf/cdo/security/internal/ui/editor/CDOSecurityFormEditor.java
index 15df2e1773..ac63369910 100644
--- a/plugins/org.eclipse.emf.cdo.security.ui/src/org/eclipse/emf/cdo/security/internal/ui/editor/CDOSecurityFormEditor.java
+++ b/plugins/org.eclipse.emf.cdo.security.ui/src/org/eclipse/emf/cdo/security/internal/ui/editor/CDOSecurityFormEditor.java
@@ -67,6 +67,8 @@ public class CDOSecurityFormEditor extends FormEditor implements IEditingDomainP
private CDOSecurityPage mainPage;
+ private CommandStackListener dirtyStackListener;
+
public CDOSecurityFormEditor()
{
}
@@ -158,21 +160,43 @@ public class CDOSecurityFormEditor extends FormEditor implements IEditingDomainP
initializeEditingDomain();
}
+ @Override
+ public void dispose()
+ {
+ try
+ {
+ if (dirtyStackListener != null)
+ {
+ if (editingDomain != null)
+ {
+ editingDomain.getCommandStack().removeCommandStackListener(dirtyStackListener);
+ }
+
+ dirtyStackListener = null;
+ }
+ }
+ finally
+ {
+ super.dispose();
+ }
+ }
+
protected void initializeEditingDomain()
{
try
{
CDOResource resource = getResource();
view = resource.cdoView();
-
- BasicCommandStack commandStack = new BasicCommandStack();
- commandStack.addCommandStackListener(new CommandStackListener()
+ dirtyStackListener = new CommandStackListener()
{
public void commandStackChanged(final EventObject event)
{
fireDirtyStateChanged();
}
- });
+ };
+
+ BasicCommandStack commandStack = new BasicCommandStack();
+ commandStack.addCommandStackListener(dirtyStackListener);
ResourceSet resourceSet = view.getResourceSet();
editingDomain = createEditingDomain(commandStack, resourceSet);

Back to the top