Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-30 13:19:35 -0400
committerEike Stepper2008-10-30 13:19:35 -0400
commiteddb19fa0136b59d339e28630b88efa75b433357 (patch)
tree74d22e9480b4ad0cb77b85bd392bfc4660f99f31
parent1ac4399427edd203ac051d59235884de152d406a (diff)
downloadcdo-eddb19fa0136b59d339e28630b88efa75b433357.tar.gz
cdo-eddb19fa0136b59d339e28630b88efa75b433357.tar.xz
cdo-eddb19fa0136b59d339e28630b88efa75b433357.zip
[252821] [UI] Hide missing local packages from "New Root" menu
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252821
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 60ff7aac99..e204332fad 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.CDOSessionPackageManager;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.common.model.CDOClass;
@@ -1985,13 +1986,23 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
protected boolean populateNewRoot(MenuManager menuManager)
{
boolean populated = false;
- List<CDOPackage> cdoPackages = Arrays.asList(view.getSession().getPackageManager().getPackages());
+ CDOSessionPackageManager packageManager = view.getSession().getPackageManager();
+ List<CDOPackage> cdoPackages = Arrays.asList(packageManager.getPackages());
Collections.sort(cdoPackages);
for (CDOPackage cdoPackage : cdoPackages)
{
if (!cdoPackage.isSystem())
{
+ try
+ {
+ packageManager.convert(cdoPackage);
+ }
+ catch (Exception ex)
+ {
+ continue;
+ }
+
List<CDOClass> cdoClasses = Arrays.asList(cdoPackage.getConcreteClasses());
Collections.sort(cdoClasses);
// TODO Sorting by class name may not have the desired effect if the labels are computed by an ItemProvider!
@@ -1999,6 +2010,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
if (!cdoClasses.isEmpty())
{
MenuManager submenuManager = new MenuManager(cdoPackage.getPackageURI());
+
for (CDOClass cdoClass : cdoClasses)
{
// TODO Optimize/cache this?

Back to the top