diff --git a/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java b/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
index b0121c6..4ba57f7 100644
--- a/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
+++ b/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
@@ -65,6 +65,7 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SubMonitor;
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.core.runtime.content.IContentTypeManager;
@@ -78,9 +79,11 @@
 import org.eclipse.jdt.core.IField;
 import org.eclipse.jdt.core.IImportDeclaration;
 import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaModel;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.ILocalVariable;
 import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageDeclaration;
 import org.eclipse.jdt.core.IPackageFragment;
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.IParent;
@@ -1150,14 +1153,8 @@
 
         String packageName = pe.getPackageName();
 
-        IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
-        VersionRangeBoundingRule lowerBoundRule = VersionRangeBoundingRule.valueOf( store
-            .getString( SigilCore.DEFAULT_VERSION_LOWER_BOUND ) );
-        VersionRangeBoundingRule upperBoundRule = VersionRangeBoundingRule.valueOf( store
-            .getString( SigilCore.DEFAULT_VERSION_UPPER_BOUND ) );
-
         Version version = pe.getVersion();
-        VersionRange versions = VersionRange.newInstance( version, lowerBoundRule, upperBoundRule );
+        VersionRange versions = ModelHelper.getDefaultRange(version);
 
         IPackageImport pi = ModelElementFactory.getInstance().newModelElement( IPackageImport.class );
         pi.setPackageName( packageName );
@@ -1258,4 +1255,55 @@
 
         throw new JavaModelException( new IllegalStateException( "Missing type for " + root ), IStatus.ERROR );
     }
+
+
+    public static Set<String> findLocalPackageDependencies(
+        ISigilProjectModel project, String packageName, IProgressMonitor monitor) throws JavaModelException
+    {
+        Set<String> imports = findJavaImports( project, monitor );
+        imports.remove(packageName);
+        return imports;
+    }
+
+
+    public static Set<String> findLocalPackageUsers(
+        ISigilProjectModel project, String packageName, IProgressMonitor monitor) throws JavaModelException
+    {
+        Set<String> imports = new HashSet<String>();
+        Set<String> check = new HashSet<String>();
+        for ( IPackageFragment root : project.getJavaModel().getPackageFragments() )
+        {
+            IPackageFragmentRoot rt = ( IPackageFragmentRoot ) root
+                .getAncestor( IJavaElement.PACKAGE_FRAGMENT_ROOT );
+
+            if ( isInClassPath( project, rt ) )
+            {
+                for ( ICompilationUnit cu : root.getCompilationUnits() )
+                {
+                    IPackageFragment pack = (IPackageFragment) cu.getAncestor(IJavaModel.PACKAGE_FRAGMENT);
+                    if ( !pack.getElementName().equals(packageName)) {
+                        scanImports( cu, check );
+                        if (check.contains(packageName)) {
+                            imports.add(pack.getElementName());
+                        }
+                    }
+                    check.clear();
+                }
+
+                for ( IClassFile cf : root.getClassFiles() )
+                {
+                    IPackageFragment pack = (IPackageFragment) cf.getAncestor(IJavaModel.PACKAGE_FRAGMENT);
+                    if ( !pack.getElementName().equals(packageName)) {
+                        scanImports( cf, check );
+                        if (check.contains(packageName)) {
+                            imports.add(pack.getElementName());
+                        }
+                    }
+                    check.clear();
+                }
+            }
+        }
+        
+        return imports;
+    }
 }
\ No newline at end of file
diff --git a/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/ModelHelper.java b/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/ModelHelper.java
index 4f70900..af41e38 100644
--- a/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/ModelHelper.java
+++ b/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/ModelHelper.java
@@ -20,15 +20,24 @@
 package org.apache.felix.sigil.eclipse.model.util;
 
 
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.felix.sigil.common.osgi.VersionRange;
+import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
+import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.model.ICapabilityModelElement;
 import org.apache.felix.sigil.model.ICompoundModelElement;
 import org.apache.felix.sigil.model.IModelElement;
 import org.apache.felix.sigil.model.IModelWalker;
 import org.apache.felix.sigil.model.IRequirementModelElement;
+import org.apache.felix.sigil.model.ModelElementFactory;
+import org.apache.felix.sigil.model.osgi.IPackageExport;
+import org.apache.felix.sigil.model.osgi.IPackageImport;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.osgi.framework.Version;
 
 
 public class ModelHelper
@@ -77,5 +86,35 @@
             }
         }
     }
+    
+    public static VersionRange getDefaultRange(Version version) {
+        IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
+        
+        VersionRangeBoundingRule lowerBoundRule = VersionRangeBoundingRule.valueOf( store
+            .getString( SigilCore.DEFAULT_VERSION_LOWER_BOUND ) );
+        VersionRangeBoundingRule upperBoundRule = VersionRangeBoundingRule.valueOf( store
+            .getString( SigilCore.DEFAULT_VERSION_UPPER_BOUND ) );
+
+        VersionRange selectedVersions = VersionRange.newInstance( version, lowerBoundRule, upperBoundRule );
+        return selectedVersions;
+    }
+    
+    public static IPackageExport findExport(ISigilProjectModel sigil, final String packageName) {
+        final ArrayList<IPackageExport> found = new ArrayList<IPackageExport>(1);
+        sigil.visit(new IModelWalker()
+        {            
+            public boolean visit(IModelElement element)
+            {
+                if (element instanceof IPackageExport) {
+                    IPackageExport pe = (IPackageExport) element;
+                    if (pe.getPackageName().equals(packageName)) {
+                        found.add(pe);
+                    }
+                }
+                return found.isEmpty();
+            }
+        });
+        return found.isEmpty() ? null : found.get(0);
+    }
 
 }
