Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdumoulin2012-02-21 19:40:18 -0500
committercdumoulin2012-02-21 19:40:18 -0500
commit263423f7a01ce1e8c475c09bee6f3b905ae21b7f (patch)
treeedba83b444fb19ee22b3c101d133c964a7a89f06 /plugins
parentbc2fbe85dc0e0606b800b34287c1dc473057e5fd (diff)
downloadorg.eclipse.papyrus-263423f7a01ce1e8c475c09bee6f3b905ae21b7f.tar.gz
org.eclipse.papyrus-263423f7a01ce1e8c475c09bee6f3b905ae21b7f.tar.xz
org.eclipse.papyrus-263423f7a01ce1e8c475c09bee6f3b905ae21b7f.zip
372175: [modelExplorer] close and open editor action do not work properly
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372175 - now closing the last editor of a folder also close this folder - open and close command close correctly any kind of selected diagram (see CloseHandler.java OpenHandler.java) - Some new methods in AbstractModelExplorerHandler.java can be reused in the subclasses.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageMngrImpl.java5
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/model/sashwindowsdi.uml145
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/SashModel.java8
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/impl/SashModelImpl.java25
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java110
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java41
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java131
7 files changed, 318 insertions, 147 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageMngrImpl.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageMngrImpl.java
index 5f2f583b47c..84f511d2a09 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageMngrImpl.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/PageMngrImpl.java
@@ -21,6 +21,7 @@ import java.util.List;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
+import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder;
/**
@@ -84,7 +85,7 @@ public class PageMngrImpl implements IPageMngr {
public void closePage(Object pageIdentifier) {
contentChangedEventProvider.setDeliver(false);
- diSashModel.getSashModel().removePage(pageIdentifier);
+ diSashModel.getSashModel().removePageAndEmptyFolder(pageIdentifier);
contentChangedEventProvider.setDeliver(true);
}
@@ -151,7 +152,7 @@ public class PageMngrImpl implements IPageMngr {
diSashModel.getPageList().removePage(pageIdentifier);
contentChangedEventProvider.setDeliver(false);
- diSashModel.getSashModel().removePage(pageIdentifier);
+ diSashModel.getSashModel().removePageAndEmptyFolder(pageIdentifier);
contentChangedEventProvider.setDeliver(true);
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/model/sashwindowsdi.uml b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/model/sashwindowsdi.uml
index 014b02ff374..dade747e4a3 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/model/sashwindowsdi.uml
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/model/sashwindowsdi.uml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/4" xmlns:Ecore_1="http://www.eclipse.org/uml2/schemas/Ecore/5" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/4 pathmap://UML_PROFILES/Ecore.profile.uml#_B7dOIMEREduRdatXodjBjA http://www.eclipse.org/uml2/schemas/Ecore/5 pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA">
- <uml:Model xmi:id="_NuHhwEJVEd6kIY39uis5Uw" name="di">
+<xmi:XMI xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/4" xmlns:Ecore_1="http://www.eclipse.org/uml2/schemas/Ecore/5" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/4 pathmap://UML_PROFILES/Ecore.profile.uml#_B7dOIMEREduRdatXodjBjA http://www.eclipse.org/uml2/schemas/Ecore/5 pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA">
+ <uml:Model xmi:id="_NuHhwEJVEd6kIY39uis5Uw" name="di" URI="http://www.eclipse.org/papyrus/0.7.0/sashdi">
<packageImport xmi:id="_NuHhwUJVEd6kIY39uis5Uw">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
@@ -14,17 +14,17 @@ A SashModel can have several windows containing panels separated by sashes. Such
containing pages.</body>
</ownedComment>
<ownedAttribute xmi:id="_9KYNMEJVEd6kIY39uis5Uw" name="windows" type="_Xa5wIEJVEd6kIY39uis5Uw" aggregation="composite" association="_9JomUEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9KYNMkJVEd6kIY39uis5Uw" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9KYNMUJVEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9KYNMkJVEd6kIY39uis5Uw" value="*"/>
</ownedAttribute>
<ownedAttribute xmi:id="_mW0_EEJkEd6kIY39uis5Uw" name="currentSelection" type="_fbWYgEJVEd6kIY39uis5Uw" isUnique="false" association="_mT2jkEJkEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_mW0_EkJkEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mW0_EUJkEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_mW0_EkJkEd6kIY39uis5Uw" value="1"/>
</ownedAttribute>
<ownedOperation xmi:id="_wdFgUEV4Ed6g-YgfS2DHrA" name="addPage">
<ownedParameter xmi:id="_yMF_0EV4Ed6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_1N0EYUV4Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_1N0EYEV4Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_1N0EYUV4Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_1N0EYkV4Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -32,8 +32,8 @@ containing pages.</body>
</ownedOperation>
<ownedOperation xmi:id="_m7xPsEa4Ed6g-YgfS2DHrA" name="removePage">
<ownedParameter xmi:id="_m7xPsUa4Ed6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_m7xPska4Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_m7xPs0a4Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_m7xPska4Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_m7xPtEa4Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -46,15 +46,15 @@ Return the pageRef or null if not found.&#xD;
Lookup in the entire SashModel structure.</body>
</ownedComment>
<ownedParameter xmi:id="_e9ojYUbXEd6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_e9ojYkbXEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_e9ojY0bXEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_e9ojYkbXEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_e9ojZEbXEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_UTCMcEbYEd6g-YgfS2DHrA" name="null" type="_h_HVwEJVEd6kIY39uis5Uw" direction="return">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Wg5LIEbYEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_WgwBMEbYEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Wg5LIEbYEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_Wg5LIUbYEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -62,30 +62,30 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_q8zekEbsEd6g-YgfS2DHrA" name="movePage">
<ownedParameter xmi:id="_sQ_qUEbsEd6g-YgfS2DHrA" name="srcParentFolder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_wdW9EEbsEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_wdNzIEbsEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_wdW9EEbsEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_wdW9EUbsEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_q8zekUbsEd6g-YgfS2DHrA" name="srcIndex" type="_Hkk78EVbEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q8zekkbsEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_q8zek0bsEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q8zekkbsEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_q8zelEbsEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_wqxuAEbsEd6g-YgfS2DHrA" name="targetParentFolder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_y6twUUbsEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_y6twUEbsEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_y6twUUbsEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_y6twUkbsEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_q8zelUbsEd6g-YgfS2DHrA" name="targetIndex">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q8zelkbsEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_q8zel0bsEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q8zelkbsEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_q8zemEbsEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -93,23 +93,23 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_vnqNcEoIEd6ussMWxXGeXg" name="insertFolder">
<ownedParameter xmi:id="_vnqNcUoIEd6ussMWxXGeXg" name="folderToInsert" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNckoIEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vnqNc0oIEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNckoIEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_vnqNdEoIEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_vnqNeUoIEd6ussMWxXGeXg" name="refFolder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNekoIEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vnqNe0oIEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNekoIEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_vnqNfEoIEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_vnqNfUoIEd6ussMWxXGeXg" name="refFolderSide">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNfkoIEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vnqNf0oIEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vnqNfkoIEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_vnqNgEoIEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -117,22 +117,22 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_Kvf9cEoJEd6ussMWxXGeXg" name="movePage">
<ownedParameter xmi:id="_Kvf9cUoJEd6ussMWxXGeXg" name="srcParentFolder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9ckoJEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Kvf9c0oJEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9ckoJEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_Kvf9dEoJEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_Kvf9dUoJEd6ussMWxXGeXg" name="srcIndex" type="_Hkk78EVbEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9dkoJEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Kvf9d0oJEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9dkoJEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_Kvf9eEoJEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_Kvf9eUoJEd6ussMWxXGeXg" name="targetParentFolder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9ekoJEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Kvf9e0oJEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Kvf9ekoJEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_Kvf9fEoJEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -140,8 +140,8 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_OoMtUEoJEd6ussMWxXGeXg" name="removeEmptyFolder">
<ownedParameter xmi:id="_OoMtUUoJEd6ussMWxXGeXg" name="folder" type="_fbWYgEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_OoMtUkoJEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_OoMtU0oJEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_OoMtUkoJEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_OoMtVEoJEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -157,8 +157,8 @@ Lookup in the entire SashModel structure.</body>
<body>Remove pages other than the one specified from the model. Intermediate folders are also removed.</body>
</ownedComment>
<ownedParameter xmi:id="_-TkSoU4OEd-B2uXHu4qMXg" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-TkSok4OEd-B2uXHu4qMXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_-TkSo04OEd-B2uXHu4qMXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-TkSok4OEd-B2uXHu4qMXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_-TkSpE4OEd-B2uXHu4qMXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -169,8 +169,8 @@ Lookup in the entire SashModel structure.</body>
<body>Get the first available window.</body>
</ownedComment>
<ownedParameter xmi:id="_9JGOIE4PEd-B2uXHu4qMXg" name="window" type="_Xa5wIEJVEd6kIY39uis5Uw" direction="return">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__PD1EU4PEd-B2uXHu4qMXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="__PD1EE4PEd-B2uXHu4qMXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__PD1EU4PEd-B2uXHu4qMXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="__PD1Ek4PEd-B2uXHu4qMXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -181,26 +181,35 @@ Lookup in the entire SashModel structure.</body>
<body>Lookup the first available folder.</body>
</ownedComment>
<ownedParameter xmi:id="__o-w8E4PEd-B2uXHu4qMXg" name="folder" type="_fbWYgEJVEd6kIY39uis5Uw" direction="return">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_BO6M8E4QEd-B2uXHu4qMXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_BOwb8E4QEd-B2uXHu4qMXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_BO6M8E4QEd-B2uXHu4qMXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_BO6M8U4QEd-B2uXHu4qMXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
</ownedOperation>
+ <ownedOperation xmi:id="_fPvj8FgxEeGNKLzLkykmJw" name="removePageAndEmptyFolder">
+ <ownedParameter xmi:id="_fPvj8VgxEeGNKLzLkykmJw" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_fPvj8lgxEeGNKLzLkykmJw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_fPvj81gxEeGNKLzLkykmJw" value="1"/>
+ <defaultValue xmi:type="uml:LiteralString" xmi:id="_fPvj9FgxEeGNKLzLkykmJw">
+ <value xsi:nil="true"/>
+ </defaultValue>
+ </ownedParameter>
+ </ownedOperation>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_Xa5wIEJVEd6kIY39uis5Uw" name="Window">
<generalization xmi:id="_95DboEJWEd6kIY39uis5Uw" general="_86BAgEJWEd6kIY39uis5Uw"/>
<ownedAttribute xmi:id="_yWfIQESDEd6kIY39uis5Uw" name="position" visibility="public" type="_jc9vQESDEd6kIY39uis5Uw" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_zpoyMUSDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_zpoyMESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_zpoyMUSDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_zpx8IESDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedAttribute xmi:id="_z0glcESDEd6kIY39uis5Uw" name="size" visibility="public" type="_lh4NUESDEd6kIY39uis5Uw" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_1I2iMESDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_1ItYQESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_1I2iMESDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_1I2iMUSDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
@@ -209,14 +218,14 @@ Lookup in the entire SashModel structure.</body>
<ownedComment xmi:id="_xQZ88EsFEd6MxdnlcgT3eA" annotatedElement="_lnNFMEsFEd6MxdnlcgT3eA">
<body>Redefine children.</body>
</ownedComment>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9Gk5sEsFEd6MxdnlcgT3eA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9GbvwEsFEd6MxdnlcgT3eA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9Gk5sEsFEd6MxdnlcgT3eA" value="1"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_Zx2ZYEJVEd6kIY39uis5Uw" name="AbstractPanel" isAbstract="true">
<ownedAttribute xmi:id="__CoIQEJVEd6kIY39uis5Uw" name="parent" type="_86BAgEJWEd6kIY39uis5Uw" isUnique="false" association="__CVNUEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__CoIQUJVEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="__CoIQkJVEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__CoIQUJVEd6kIY39uis5Uw" value="1"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_eE7YIEJVEd6kIY39uis5Uw" name="SashPanel">
@@ -226,38 +235,38 @@ Lookup in the entire SashModel structure.</body>
<ownedComment xmi:id="_AWCzYESEEd6kIY39uis5Uw" annotatedElement="_8rplQESDEd6kIY39uis5Uw">
<body>Position of the sash in the panel. The position is in percent. The value should be between 0 and 100.</body>
</ownedComment>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__mEH8ESDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="__l6W8ESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__mEH8ESDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="__mEH8USDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedAttribute xmi:id="_1nx64EbpEd6g-YgfS2DHrA" name="direction" visibility="public" isUnique="false">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_4G620EbpEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_4GxF0EbpEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_4G620EbpEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_4G620UbpEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedOperation xmi:id="_eGcSEEoLEd6ussMWxXGeXg" name="setChildren">
<ownedParameter xmi:id="_f_4f8EoLEd6ussMWxXGeXg" name="leftChild" type="_Zx2ZYEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_jquaAEoLEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_jqlQEEoLEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_jquaAEoLEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_jquaAUoLEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_j57ToEoLEd6ussMWxXGeXg" name="rightChild" type="_Zx2ZYEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_l57cgEoLEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_l5xrgEoLEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_l57cgEoLEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_l57cgUoLEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_mVfXIEoLEd6ussMWxXGeXg" name="direction" type="_Hkk78EVbEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oo3vAUoLEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_oo3vAEoLEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oo3vAUoLEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_oo3vAkoLEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -265,8 +274,8 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_tzrhgEuAEd6kcPOdk0bn7w" name="delete">
<ownedParameter xmi:id="_yPQU8EuAEd6kcPOdk0bn7w" name="childToDelete" type="_Zx2ZYEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_2M3aAUuAEd6kcPOdk0bn7w" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_2M3aAEuAEd6kcPOdk0bn7w" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_2M3aAUuAEd6kcPOdk0bn7w" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_2M3aAkuAEd6kcPOdk0bn7w">
<value xsi:nil="true"/>
</defaultValue>
@@ -276,21 +285,21 @@ Lookup in the entire SashModel structure.</body>
<packagedElement xmi:type="uml:Class" xmi:id="_fbWYgEJVEd6kIY39uis5Uw" name="TabFolder">
<generalization xmi:id="_71vVgEJVEd6kIY39uis5Uw" general="_Zx2ZYEJVEd6kIY39uis5Uw"/>
<ownedAttribute xmi:id="_ANIzkEJWEd6kIY39uis5Uw" name="children" type="_h_HVwEJVEd6kIY39uis5Uw" aggregation="composite" association="_AM_CkEJWEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ANIzkkJWEd6kIY39uis5Uw" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_ANIzkUJWEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ANIzkkJWEd6kIY39uis5Uw" value="*"/>
</ownedAttribute>
<ownedOperation xmi:id="_Cqh_oEViEd6g-YgfS2DHrA" name="movePage">
<ownedParameter xmi:id="_ETI8MEViEd6g-YgfS2DHrA" name="oldIndex">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_G2wIcUViEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_G2wIcEViEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_G2wIcUViEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_G2wIckViEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_X27C4EV4Ed6g-YgfS2DHrA" name="newIndex" type="_Hkk78EVbEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_amdyUUV4Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_amdyUEV4Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_amdyUUV4Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_amdyUkV4Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -298,8 +307,8 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_oZu3cEWEEd6g-YgfS2DHrA" name="addPage">
<ownedParameter xmi:id="_oZu3cUWEEd6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oZu3ckWEEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_oZu3c0WEEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oZu3ckWEEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_oZu3dEWEEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -307,8 +316,8 @@ Lookup in the entire SashModel structure.</body>
</ownedOperation>
<ownedOperation xmi:id="_oEQBQEblEd6g-YgfS2DHrA" name="removePage">
<ownedParameter xmi:id="_oEQBQUblEd6g-YgfS2DHrA" name="pageIndex" type="_Hkk78EVbEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oEQBQkblEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_oEQBQ0blEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_oEQBQkblEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_oEQBREblEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -317,21 +326,21 @@ Lookup in the entire SashModel structure.</body>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_h_HVwEJVEd6kIY39uis5Uw" name="PageRef">
<ownedAttribute xmi:id="_ANIzk0JWEd6kIY39uis5Uw" name="parent" type="_fbWYgEJVEd6kIY39uis5Uw" isUnique="false" association="_AM_CkEJWEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ANIzlEJWEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_ANIzlUJWEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ANIzlEJWEd6kIY39uis5Uw" value="1"/>
</ownedAttribute>
<ownedAttribute xmi:id="_b94xUEnjEd6ussMWxXGeXg" name="emfPageIdentifier" visibility="private" isUnique="false" association="_b3enUEnjEd6ussMWxXGeXg">
<type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/Ecore.metamodel.uml#EObject"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_b-CiUUnjEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_b-CiUEnjEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_b-CiUUnjEd6ussMWxXGeXg" value="1"/>
</ownedAttribute>
<ownedAttribute xmi:id="_GrqUYEnkEd6ussMWxXGeXg" name="pageIdentifier" visibility="public" isLeaf="true" type="_A-BP8EVhEd6g-YgfS2DHrA" isUnique="false" isDerived="true">
<ownedComment xmi:id="_YfXUoEnmEd6ussMWxXGeXg" annotatedElement="_GrqUYEnkEd6ussMWxXGeXg">
<body>pageIdentifier can be a plain JavaObject or an EObject.&#xD;
They are not stored in the same place.</body>
</ownedComment>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_W-1gkEnnEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_W-rvkEnnEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_W-1gkEnnEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_W-1gkUnnEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -340,24 +349,24 @@ They are not stored in the same place.</body>
<ownedComment xmi:id="_UZ2QwEnmEd6ussMWxXGeXg" annotatedElement="_RkM5UEnmEd6ussMWxXGeXg">
<body>Storage to store Identifier that are not EObject.</body>
</ownedComment>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_DXj_AUnnEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_DXj_AEnnEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_DXj_AUnnEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_DXtI8EnnEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedOperation xmi:id="_BxkKcEbaEd6g-YgfS2DHrA" name="isForIdentifier">
<ownedParameter xmi:id="_BxkKcUbaEd6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_BxkKckbaEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_BxkKc0baEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_BxkKckbaEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_BxkKdEbaEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_D0_awEbaEd6g-YgfS2DHrA" name="null" direction="return">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_GFO_EUbaEd6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_GFO_EEbaEd6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_GFO_EUbaEd6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_GFO_EkbaEd6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -366,8 +375,8 @@ They are not stored in the same place.</body>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_zd5g0EJVEd6kIY39uis5Uw" name="AbstractPage">
<ownedAttribute xmi:id="_rLVHwEa1Ed6g-YgfS2DHrA" name="pageIdentifier" visibility="public" type="_A-BP8EVhEd6g-YgfS2DHrA" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_rLVHwUa1Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_rLVHwka1Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_rLVHwUa1Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_rLVHw0a1Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -375,16 +384,16 @@ They are not stored in the same place.</body>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_9JomUEJVEd6kIY39uis5Uw" name="A_SashWindowsRoot_Window" memberEnd="_9KYNMEJVEd6kIY39uis5Uw _9Kh-MEJVEd6kIY39uis5Uw">
<ownedEnd xmi:id="_9Kh-MEJVEd6kIY39uis5Uw" name="sashWindowsRoot" type="_UiIMMEJVEd6kIY39uis5Uw" isUnique="false" association="_9JomUEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9Kh-MUJVEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9Kh-MkJVEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9Kh-MUJVEd6kIY39uis5Uw" value="1"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="__CVNUEJVEd6kIY39uis5Uw" name="A_PanelParent_AbstractPanel" memberEnd="__Ce-UEJVEd6kIY39uis5Uw __CoIQEJVEd6kIY39uis5Uw"/>
<packagedElement xmi:type="uml:Association" xmi:id="_AM_CkEJWEd6kIY39uis5Uw" name="A_TabFolder_AbstractPageRef" memberEnd="_ANIzkEJWEd6kIY39uis5Uw _ANIzk0JWEd6kIY39uis5Uw"/>
<packagedElement xmi:type="uml:Class" xmi:id="_86BAgEJWEd6kIY39uis5Uw" name="PanelParent" isAbstract="true">
<ownedAttribute xmi:id="__Ce-UEJVEd6kIY39uis5Uw" name="children" type="_Zx2ZYEJVEd6kIY39uis5Uw" aggregation="composite" association="__CVNUEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__Ce-UkJVEd6kIY39uis5Uw" value="2"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="__Ce-UUJVEd6kIY39uis5Uw" value="2"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__Ce-UkJVEd6kIY39uis5Uw" value="2"/>
</ownedAttribute>
<ownedOperation xmi:id="_yG3I4EoKEd6ussMWxXGeXg" name="replaceChild">
<ownedComment xmi:id="_AxysQEoLEd6ussMWxXGeXg" annotatedElement="_yG3I4EoKEd6ussMWxXGeXg">
@@ -393,15 +402,15 @@ Don't need to be implemented in TabFolder.&#xD;
Used to insert a new SashPanel.</body>
</ownedComment>
<ownedParameter xmi:id="_zqjwQEoKEd6ussMWxXGeXg" name="oldChild" type="_Zx2ZYEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_3Q7aAUoKEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_3Q7aAEoKEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_3Q7aAUoKEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_3Q7aAkoKEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
</ownedParameter>
<ownedParameter xmi:id="_3dJREEoKEd6ussMWxXGeXg" name="newChild" type="_Zx2ZYEJVEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__gbLAUoKEd6ussMWxXGeXg" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="__gbLAEoKEd6ussMWxXGeXg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__gbLAUoKEd6ussMWxXGeXg" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="__gbLAkoKEd6ussMWxXGeXg">
<value xsi:nil="true"/>
</defaultValue>
@@ -410,25 +419,25 @@ Used to insert a new SashPanel.</body>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_viyZUEJZEd6kIY39uis5Uw" name="A_PageList_PageRef" memberEnd="_vjFUQEJZEd6kIY39uis5Uw _vjYPMkJZEd6kIY39uis5Uw">
<ownedEnd xmi:id="_vjYPMkJZEd6kIY39uis5Uw" name="sashWindowsRoot" type="_b7a4cEMaEd6kIY39uis5Uw" isUnique="false" association="_viyZUEJZEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vjiAMEJZEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vjiAMUJZEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vjiAMEJZEd6kIY39uis5Uw" value="1"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_mT2jkEJkEd6kIY39uis5Uw" name="A_SashWindowsRoot_TabFolder" memberEnd="_mW0_EEJkEd6kIY39uis5Uw _mW0_E0JkEd6kIY39uis5Uw">
<ownedEnd xmi:id="_mW0_E0JkEd6kIY39uis5Uw" name="sashWindowsRoot" type="_UiIMMEJVEd6kIY39uis5Uw" isUnique="false" association="_mT2jkEJkEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_mW-wEEJkEd6kIY39uis5Uw" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mW-wEUJkEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_mW-wEEJkEd6kIY39uis5Uw" value="*"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_b7a4cEMaEd6kIY39uis5Uw" name="PageList">
<ownedAttribute xmi:id="_vjFUQEJZEd6kIY39uis5Uw" name="availablePage" type="_h_HVwEJVEd6kIY39uis5Uw" aggregation="composite" association="_viyZUEJZEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vjYPMUJZEd6kIY39uis5Uw" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vjYPMEJZEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vjYPMUJZEd6kIY39uis5Uw" value="*"/>
</ownedAttribute>
<ownedOperation xmi:id="_i92ooEa4Ed6g-YgfS2DHrA" name="addPage">
<ownedParameter xmi:id="_i92ooUa4Ed6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_i92ooka4Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_i92oo0a4Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_i92ooka4Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_i92opEa4Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -436,8 +445,8 @@ Used to insert a new SashPanel.</body>
</ownedOperation>
<ownedOperation xmi:id="_ocolgEa4Ed6g-YgfS2DHrA" name="removePage">
<ownedParameter xmi:id="_ocolgUa4Ed6g-YgfS2DHrA" name="pageIdentifier" type="_A-BP8EVhEd6g-YgfS2DHrA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ocolgka4Ed6g-YgfS2DHrA" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_ocolg0a4Ed6g-YgfS2DHrA" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ocolgka4Ed6g-YgfS2DHrA" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_ocolhEa4Ed6g-YgfS2DHrA">
<value xsi:nil="true"/>
</defaultValue>
@@ -446,38 +455,38 @@ Used to insert a new SashPanel.</body>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_-9vywEMaEd6kIY39uis5Uw" name="SashWindowsMngr">
<ownedAttribute xmi:id="_9osO4EMbEd6kIY39uis5Uw" name="pageList" type="_b7a4cEMaEd6kIY39uis5Uw" isUnique="false" aggregation="composite" association="_9k0bgEMbEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9osO4kMbEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9osO4UMbEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9osO4kMbEd6kIY39uis5Uw" value="1"/>
</ownedAttribute>
<ownedAttribute xmi:id="_-JenwEMbEd6kIY39uis5Uw" name="sashModel" type="_UiIMMEJVEd6kIY39uis5Uw" isUnique="false" aggregation="composite" association="_-EQwkEMbEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-JnxsUMbEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_-JnxsEMbEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-JnxsUMbEd6kIY39uis5Uw" value="1"/>
</ownedAttribute>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_9k0bgEMbEd6kIY39uis5Uw" name="A_MultiPageEditor_PageList" memberEnd="_9osO4EMbEd6kIY39uis5Uw _9osO40MbEd6kIY39uis5Uw">
<ownedEnd xmi:id="_9osO40MbEd6kIY39uis5Uw" name="multiPageEditor" type="_-9vywEMaEd6kIY39uis5Uw" isUnique="false" association="_9k0bgEMbEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9o1_4EMbEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9o1_4UMbEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9o1_4EMbEd6kIY39uis5Uw" value="1"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_-EQwkEMbEd6kIY39uis5Uw" name="A_MultiPageEditor_SashWindowsLayout" memberEnd="_-JenwEMbEd6kIY39uis5Uw _-JnxskMbEd6kIY39uis5Uw">
<ownedEnd xmi:id="_-JnxskMbEd6kIY39uis5Uw" name="multiPageEditor" type="_-9vywEMaEd6kIY39uis5Uw" isUnique="false" association="_-EQwkEMbEd6kIY39uis5Uw">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-Jnxs0MbEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_-JnxtEMbEd6kIY39uis5Uw"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-Jnxs0MbEd6kIY39uis5Uw" value="1"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_jc9vQESDEd6kIY39uis5Uw" name="Position">
<ownedAttribute xmi:id="_m9q14ESDEd6kIY39uis5Uw" name="x" visibility="public" isUnique="false">
<type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_pZ1WUUSDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_pZ1WUESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_pZ1WUUSDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_paIRQESDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedAttribute xmi:id="_pmDNYESDEd6kIY39uis5Uw" name="y" visibility="public" type="_Hkk78EVbEd6g-YgfS2DHrA" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q5DtYESDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_q458YESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_q5DtYESDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_q5DtYUSDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
@@ -485,15 +494,15 @@ Used to insert a new SashPanel.</body>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_lh4NUESDEd6kIY39uis5Uw" name="Size">
<ownedAttribute xmi:id="_s1CR4ESDEd6kIY39uis5Uw" name="width" visibility="public" type="_Hkk78EVbEd6g-YgfS2DHrA" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_u5NJEESDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_u5DYEESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_u5NJEESDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_u5NJEUSDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
</ownedAttribute>
<ownedAttribute xmi:id="_vnZr0ESDEd6kIY39uis5Uw" name="length" visibility="public" type="_Hkk78EVbEd6g-YgfS2DHrA" isUnique="false">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_w_dq8ESDEd6kIY39uis5Uw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_w_T58ESDEd6kIY39uis5Uw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_w_dq8ESDEd6kIY39uis5Uw" value="1"/>
<defaultValue xmi:type="uml:LiteralString" xmi:id="_w_dq8USDEd6kIY39uis5Uw">
<value xsi:nil="true"/>
</defaultValue>
@@ -505,21 +514,21 @@ Used to insert a new SashPanel.</body>
<packagedElement xmi:type="uml:PrimitiveType" xmi:id="_SNSWAEbaEd6g-YgfS2DHrA" name="boolean"/>
<packagedElement xmi:type="uml:Association" xmi:id="_b3enUEnjEd6ussMWxXGeXg" name="A_PageRef_EObject" memberEnd="_b94xUEnjEd6ussMWxXGeXg _b-CiUknjEd6ussMWxXGeXg">
<ownedEnd xmi:id="_b-CiUknjEd6ussMWxXGeXg" name="pageRef" visibility="public" type="_h_HVwEJVEd6kIY39uis5Uw" isUnique="false" association="_b3enUEnjEd6ussMWxXGeXg">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_b-MTUEnjEd6ussMWxXGeXg" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_b-MTUUnjEd6ussMWxXGeXg"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_b-MTUEnjEd6ussMWxXGeXg" value="*"/>
</ownedEnd>
</packagedElement>
<packagedElement xmi:type="uml:Association" xmi:id="_li3-0EsFEd6MxdnlcgT3eA" name="A_Window_AbstractPanel" memberEnd="_lnNFMEsFEd6MxdnlcgT3eA _lnWPIksFEd6MxdnlcgT3eA">
<ownedEnd xmi:id="_lnWPIksFEd6MxdnlcgT3eA" name="window" type="_Xa5wIEJVEd6kIY39uis5Uw" isUnique="false" association="_li3-0EsFEd6MxdnlcgT3eA">
- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_lnWPI0sFEd6MxdnlcgT3eA" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_lnWPJEsFEd6MxdnlcgT3eA"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_lnWPI0sFEd6MxdnlcgT3eA" value="*"/>
</ownedEnd>
</packagedElement>
<profileApplication xmi:id="_NuHhwkJVEd6kIY39uis5Uw">
<eAnnotations xmi:id="_NuHhw0JVEd6kIY39uis5Uw" source="http://www.eclipse.org/uml2/2.0.0/UML">
- <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/schemas/Standard/1#/"/>
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/4.0.0/UML/Profile/L2#/"/>
</eAnnotations>
- <appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
+ <appliedProfile href="pathmap://UML_PROFILES/StandardL2.profile.uml#_0"/>
</profileApplication>
<profileApplication xmi:id="_wpAy0EJfEd6kIY39uis5Uw">
<eAnnotations xmi:id="_wpJ8wEJfEd6kIY39uis5Uw" source="http://www.eclipse.org/uml2/2.0.0/UML">
@@ -527,6 +536,12 @@ Used to insert a new SashPanel.</body>
</eAnnotations>
<appliedProfile href="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
</profileApplication>
+ <profileApplication xmi:id="_cYHPgFgxEeGNKLzLkykmJw">
+ <eAnnotations xmi:id="_cYKS0FgxEeGNKLzLkykmJw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/4.0.0/UML/Profile/L3#/"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_PROFILES/StandardL3.profile.uml#_0"/>
+ </profileApplication>
</uml:Model>
<Ecore:EPackage xmi:id="_zLIxUEJfEd6kIY39uis5Uw" nsPrefix="di2" nsURI="http://www.eclipse.org/papyrus/0.7.0/sashdi" basePackage="org.eclipse.papyrus.infra.core.sashwindows.di"/>
<Ecore_1:EPackage xmi:id="_mo48QEJgEd6kIY39uis5Uw" base_Package="_NuHhwEJVEd6kIY39uis5Uw" nsPrefix="di" nsURI="http://www.eclipse.org/papyrus/0.7.0/sashdi" basePackage="org.eclipse.papyrus.sashwindows" prefix="Di">
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/SashModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/SashModel.java
index 1695e272abd..e7197bf24fb 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/SashModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/SashModel.java
@@ -93,6 +93,14 @@ public interface SashModel extends EObject {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @model pageIdentifierDataType="org.eclipse.papyrus.infra.core.sashwindows.di.JavaObject" pageIdentifierRequired="true" pageIdentifierOrdered="false"
+ * @generated
+ */
+ public void removePageAndEmptyFolder(Object pageIdentifier);
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Lookup the pageRef identified by the pageIdentifier.
* Return the pageRef or null if not found.
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/impl/SashModelImpl.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/impl/SashModelImpl.java
index 8298579252f..5aa3c8367be 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/impl/SashModelImpl.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/src/org/eclipse/papyrus/infra/core/sashwindows/di/impl/SashModelImpl.java
@@ -156,8 +156,29 @@ public class SashModelImpl extends EObjectImpl implements SashModel {
if(pageRef == null)
return;
- // Remove it
- pageRef.getParent().getChildren().remove(pageRef);
+ // Get the folder containing the page
+ TabFolder folder = pageRef.getParent();
+ // Remove the page
+ folder.getChildren().remove(pageRef);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public void removePageAndEmptyFolder(Object pageIdentifier) {
+ PageRef pageRef = lookupPage(pageIdentifier);
+ if(pageRef == null)
+ return;
+
+ // Get the folder containing the page
+ TabFolder folder = pageRef.getParent();
+ // Remove the page
+ folder.getChildren().remove(pageRef);
+ // Remove parent if empty
+ removeEmptyFolder(folder);
}
/**
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
index 96bf81ad768..6d6551e6ff2 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/AbstractModelExplorerHandler.java
@@ -13,10 +13,23 @@
*****************************************************************************/
package org.eclipse.papyrus.views.modelexplorer.handler;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.ui.handlers.HandlerUtil;
/**
* This provides facilities to get the TransactionEditingDomain and the PageManager from the Model Explorer
@@ -52,11 +65,106 @@ public abstract class AbstractModelExplorerHandler extends AbstractHandler {
protected IPageMngr getPageManager() {
IPageMngr pageMngr = null;
try {
- pageMngr = org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers.getInstance().getIPageMngr();
+ pageMngr = ServiceUtilsForActionHandlers.getInstance().getIPageMngr();
} catch (ServiceException e) {
//we are closing the editor, so the model explorer has nothing to display
// e.printStackTrace();
}
return pageMngr;
}
+
+ /**
+ * Adapt the specified object to the requested type, if possible.
+ * Return null if the object can't be adapted.
+ *
+ * @param object
+ * @param expectedClassType
+ * @return The adapted object, or null.
+ */
+ @SuppressWarnings("unchecked")
+ private <T> T adapt( Object object, Class<T> expectedClassType) {
+
+ if( object instanceof IAdaptable ) {
+ T ele = (T)((IAdaptable)object).getAdapter(expectedClassType);
+ if(ele != null) {
+ return ele;
+ }
+ // Try as EObject if the expectedClasType is sub-type of EObject.
+ if( EObject.class.isAssignableFrom( expectedClassType) ) {
+ // to EObject
+ EObject eobject = (EObject)((IAdaptable)object).getAdapter(EObject.class);
+
+ if(eobject != null && expectedClassType.isInstance(eobject)) {
+ return (T)eobject;
+ }
+ }
+ }
+
+ // Try global mechanism
+ {
+ T ele = (T)Platform.getAdapterManager().getAdapter(object, expectedClassType);
+ if(ele != null) {
+ return ele;
+ }
+ // Try as EObject if the expectedClasType is sub-type of EObject.
+ if( EObject.class.isAssignableFrom( expectedClassType) ) {
+ // to EObject
+ EObject eobject = (EObject)Platform.getAdapterManager().getAdapter(object, EObject.class);
+
+ if(eobject != null && expectedClassType.isInstance(eobject)) {
+
+ return (T)eobject;
+ }
+ }
+ }
+ // Can't be adapted
+ return null;
+
+ }
+
+ /**
+ * Filter the list, and only retain objects that can be adapted to the specified type
+ * @param objects
+ * @param class1
+ * @return
+ */
+ private <T> List<T> getAllElementAdaptedToType(List<Object> list, Class<T> expectedClassType) {
+
+ List<T> res = new ArrayList<T>();
+
+ for( Object cur : list) {
+
+ T adapted = adapt( cur, expectedClassType);
+ if( adapted != null)
+ res.add(adapted);
+ }
+ return res;
+ }
+
+ /**
+ * Get all selected element of the specified type.
+ *
+ * @param expectedType
+ * @return
+ * @throws ExecutionException
+ */
+ @SuppressWarnings("unchecked")
+ protected <T> List<T> getCurrentSelectionAdaptedToType(ExecutionEvent event, Class<T> expectedType) throws ExecutionException {
+
+ // Get selection from the workbench
+ ISelection selection = HandlerUtil.getCurrentSelectionChecked(event);
+
+ // Get the selected objects according to the type of the selected
+ if(selection instanceof IStructuredSelection)
+ {
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ return getAllElementAdaptedToType( structuredSelection.toList(), expectedType);
+ }
+ else if( selection instanceof TreeSelection) {
+ TreeSelection treeSelection = (TreeSelection)selection;
+ return getAllElementAdaptedToType( treeSelection.toList(), expectedType );
+
+ }
+ return null;
+ }
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
index abe753e7f2e..67fcbc30a87 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CloseHandler.java
@@ -14,17 +14,15 @@
package org.eclipse.papyrus.views.modelexplorer.handler;
import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.ui.handlers.HandlerUtil;
/**
* This handler allows to Close Diagrams and Tables
@@ -60,18 +58,33 @@ public class CloseHandler extends AbstractModelExplorerHandler implements IExecu
* @throws ExecutionException
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
+
IPageMngr pageMngr = getPageManager();
- if(selection instanceof IStructuredSelection && pageMngr != null) {
- if(PARAMETER_SELECTION.equals(parameter)) {
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while(iter.hasNext()) {
- pageMngr.closePage(iter.next());
- }
- } else if(PARAMETER_ALL.equals(parameter)) {
- pageMngr.closeAllOpenedPages();
- }
+ if(pageMngr == null) {
+ return null;
}
+
+ // What kind of command ?
+ if(PARAMETER_ALL.equals(parameter)) {
+ pageMngr.closeAllOpenedPages();
+ }
+
+ // Try to close each selected editor.
+ // There is no common type for object representing an editor. So,
+ // We try to get the EObject, and try to close it as an Editor.
+ List<EObject> selectedProperties = getCurrentSelectionAdaptedToType( event, EObject.class );
+ if( selectedProperties == null) {
+ // nothing to do
+ return null;
+ }
+
+
+ // Check each selected object
+ for( EObject selected : selectedProperties) {
+
+ pageMngr.closePage(selected);
+ }
+
return null;
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
index aa4c310e61a..33d7642d573 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/OpenHandler.java
@@ -15,12 +15,14 @@ package org.eclipse.papyrus.views.modelexplorer.handler;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
@@ -36,25 +38,19 @@ import org.eclipse.ui.handlers.HandlerUtil;
public class OpenHandler extends AbstractModelExplorerHandler implements IExecutableExtension {
-
-
- /** parameters for this action */
- /**
- * close all open elements
- */
- public static final String PARAMETER_CLOSE = "close"; //$NON-NLS-1$
-
/**
* Close only the selected elements
*/
- public static final String PARAMETER_ALREADY_OPEN = "already_open"; //$NON-NLS-1$
-
+ public static final String IS_DUPLICATE_EDITOR_ALLOWED_PARAMETER = "isDuplicateEditorAllowed"; //$NON-NLS-1$
- /** parameter ID */
- protected String parameterID = "open_parameter"; //$NON-NLS-1$
- /** parameter for this handler */
- protected String parameter = null;
+ /**
+ * Return true if the open command allow to duplicate editor that are already
+ * opened.
+ * Return false if open command should not duplicate already opened editor.
+ * This property can be set from the plugin.xml.
+ */
+ protected boolean isDuplicateDiagramAllowed = false;
/**
@@ -66,16 +62,30 @@ public class OpenHandler extends AbstractModelExplorerHandler implements IExecut
* @throws ExecutionException
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
IPageMngr pageMngr = getPageManager();
-
- if(selection instanceof IStructuredSelection && pageMngr != null) {
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while(iter.hasNext()) {
- pageMngr.openPage(iter.next());
+ if(pageMngr == null) {
+ return null;
+ }
+
+ // Try to close each selected editor.
+ // There is no common type for object representing an editor. So,
+ // We try to get the EObject, and try to close it as an Editor.
+ List<EObject> selectedProperties = getCurrentSelectionAdaptedToType( event, EObject.class );
+ if( selectedProperties == null) {
+ // nothing to do
+ return null;
+ }
+
+ // Check each selected object
+ for( EObject selected : selectedProperties) {
+
+ if( isDuplicateDiagramAllowed || !pageMngr.isOpen(selected) ) {
+ pageMngr.openPage(selected);
}
}
+
return null;
+
}
/**
@@ -84,32 +94,34 @@ public class OpenHandler extends AbstractModelExplorerHandler implements IExecut
*
* @return
*/
- @Override
- public boolean isEnabled() {
- IPageMngr pageMngr = getPageManager();
- if(pageMngr != null) {
- IStructuredSelection selection = getSelectedElement();
- Iterator<?> iter = selection.iterator();
- if(selection != null) {
- if(PARAMETER_CLOSE.equals(this.parameter)) {
- while(iter.hasNext()) {
- if(pageMngr.isOpen(iter.next())) {
- return false;
- }
- }
- return true;
- } else if(PARAMETER_ALREADY_OPEN.equals(this.parameter)) {
- while(iter.hasNext()) {
- if(pageMngr.isOpen(iter.next())) {
- return true;
- }
- }
- return false;
- }
- }
- }
- return false;
- }
+// @Override
+// public boolean isEnabled() {
+// IPageMngr pageMngr = getPageManager();
+// if(pageMngr == null) {
+// return false;
+// }
+//
+// // Try to close each selected editor.
+// // There is no common type for object representing an editor. So,
+// // We try to get the EObject, and try to close it as an Editor.
+// List<EObject> selectedProperties = getCurrentSelectionAdaptedToType( event, EObject.class );
+// if( selectedProperties == null) {
+// // nothing to do
+// return false;
+// }
+//
+// // Check each selected object
+// // Return true if one of them is enabled
+// for( EObject selected : selectedProperties) {
+//
+// if( isDuplicateDiagramAllowed || !pageMngr.isOpen(selected) ) {
+// return true;
+// }
+// }
+//
+//
+// return false;
+// }
/**
*
@@ -122,26 +134,19 @@ public class OpenHandler extends AbstractModelExplorerHandler implements IExecut
* @throws CoreException
*/
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- if(data instanceof Hashtable && this.parameterID != null) {
- this.parameter = (String)((Hashtable)data).get(this.parameterID);
+ if( ! (data instanceof Hashtable) ) {
+ return;
}
- }
-
- /**
- * Returns the selected elements
- *
- * @return
- * the selected elements
- */
- protected IStructuredSelection getSelectedElement() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- return (IStructuredSelection)selection;
+
+ @SuppressWarnings("rawtypes")
+ Hashtable map = (Hashtable)data;
+
+ try {
+ isDuplicateDiagramAllowed = Boolean.parseBoolean((String)map.get(IS_DUPLICATE_EDITOR_ALLOWED_PARAMETER) );
+ } catch (Exception e) {
+ // silently fail;
}
- return null;
}
-
-
}

Back to the top