-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[176] Adapt SiriusDiagramActionBarContributor to avoid memory leak
Create a specific ActionBarContributor for each specific implementation of SiriusDiagramEditor to avoid a duplication of ActionRegistry: one for "SiriusDiagramEditor.class" and one for real implementation ("DDiagramEditorImpl.class" or "EcoreEntitiesReadOnlyEditor.class"). Indeed, only one of the ActionRegistry is correctly cleaned at the closing of the editor. To avoid a performance problem, the timeout "sun.awt.datatransfer.timeout" has been set to 100 ms instead of 10000 ms for the automatic tests (see comment on issue [1] for more details). [1] #176 (comment) Bug: #176
- Loading branch information
Showing
10 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...am.ui/src-diag/org/eclipse/sirius/diagram/ui/part/DDiagramEditorActionBarContributor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.diagram.ui.part; | ||
|
||
import org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl; | ||
|
||
/** | ||
* Specific ActionBarContributor for {@link DDiagramEditorImpl} instance to avoid potential leaks on actions for action | ||
* bar of this editor. | ||
* | ||
* @author Laurent Redor | ||
*/ | ||
public class DDiagramEditorActionBarContributor extends SiriusDiagramActionBarContributor { | ||
@Override | ||
protected Class<?> getEditorClass() { | ||
return DDiagramEditorImpl.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../eclipse/sirius/sample/ecore/design/editor/ui/part/EcoreEntitiesActionBarContributor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Obeo. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.sample.ecore.design.editor.ui.part; | ||
|
||
import org.eclipse.sirius.diagram.ui.part.SiriusDiagramActionBarContributor; | ||
import org.eclipse.sirius.sample.ecore.design.editor.EcoreEntitiesReadOnlyEditor; | ||
|
||
/** | ||
* Specific ActionBarContributor for {@link EcoreEntitiesReadOnlyEditor} instance to avoid potential leaks on actions | ||
* for action bar of this editor. | ||
* | ||
* @author Laurent Redor | ||
*/ | ||
public class EcoreEntitiesActionBarContributor extends SiriusDiagramActionBarContributor { | ||
@Override | ||
protected Class<?> getEditorClass() { | ||
return EcoreEntitiesReadOnlyEditor.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters