felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r981604 [14/22] - in /felix/trunk/sigil: common/core.tests/src/org/apache/felix/sigil/common/core/ common/core.tests/src/org/apache/felix/sigil/common/core/internal/model/osgi/ common/core/src/org/apache/felix/sigil/common/bnd/ common/core/...
Date Mon, 02 Aug 2010 17:08:20 GMT
Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependenciesForm.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependenciesForm.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependenciesForm.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependenciesForm.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.Set;
 
 import org.apache.felix.sigil.common.model.IModelElement;
@@ -35,7 +34,6 @@ import org.eclipse.ui.forms.widgets.Scro
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-
 public class DependenciesForm extends SigilPage
 {
 
@@ -47,29 +45,26 @@ public class DependenciesForm extends Si
     private ImportPackagesSection importPackages;
     private RequiresBundleSection requiresSection;
 
-
-    public DependenciesForm( FormEditor editor, ISigilProjectModel project, Set<IModelElement> unresolved )
+    public DependenciesForm(FormEditor editor, ISigilProjectModel project, Set<IModelElement> unresolved)
     {
-        super( editor, PAGE_ID, "Dependencies" );
+        super(editor, PAGE_ID, "Dependencies");
         this.project = project;
         this.unresolvedElements = unresolved;
     }
 
-
     @Override
     public boolean canLeaveThePage()
     {
         return !isDirty();
     }
 
-
     @Override
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent(IManagedForm managedForm)
     {
         FormToolkit toolkit = managedForm.getToolkit();
 
         ScrolledForm form = managedForm.getForm();
-        form.setText( "Dependencies" );
+        form.setText("Dependencies");
 
         Composite body = form.getBody();
         TableWrapLayout layout = new TableWrapLayout();
@@ -79,43 +74,46 @@ public class DependenciesForm extends Si
         layout.rightMargin = 10;
         layout.numColumns = 2;
         layout.horizontalSpacing = 10;
-        body.setLayout( layout );
-        body.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) );
+        body.setLayout(layout);
+        body.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
 
-        Composite left = toolkit.createComposite( body );
+        Composite left = toolkit.createComposite(body);
         layout = new TableWrapLayout();
         layout.verticalSpacing = 20;
-        left.setLayout( layout );
-        TableWrapData layoutData = new TableWrapData( TableWrapData.FILL_GRAB );
+        left.setLayout(layout);
+        TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB);
         layoutData.rowspan = 2;
-        left.setLayoutData( layoutData );
+        left.setLayoutData(layoutData);
 
-        Composite right = toolkit.createComposite( body );
+        Composite right = toolkit.createComposite(body);
         layout = new TableWrapLayout();
         layout.verticalSpacing = 20;
-        right.setLayout( layout );
-        right.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) );
+        right.setLayout(layout);
+        right.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
 
-        Composite bottom = toolkit.createComposite( body );
+        Composite bottom = toolkit.createComposite(body);
         layout = new TableWrapLayout();
         layout.verticalSpacing = 20;
-        bottom.setLayout( layout );
-        bottom.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) );
+        bottom.setLayout(layout);
+        bottom.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
 
         try
         {
-            importPackages = new ImportPackagesSection( this, left, project, unresolvedElements );
-            managedForm.addPart( importPackages );
-
-            requiresSection = new RequiresBundleSection( this, right, project, unresolvedElements );
-            managedForm.addPart( requiresSection );
-
-            DependencyManagementSection depMgmt = new DependencyManagementSection( this, bottom, project );
-            managedForm.addPart( depMgmt );
+            importPackages = new ImportPackagesSection(this, left, project,
+                unresolvedElements);
+            managedForm.addPart(importPackages);
+
+            requiresSection = new RequiresBundleSection(this, right, project,
+                unresolvedElements);
+            managedForm.addPart(requiresSection);
+
+            DependencyManagementSection depMgmt = new DependencyManagementSection(this,
+                bottom, project);
+            managedForm.addPart(depMgmt);
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to create dependencies form", e );
+            SigilCore.error("Failed to create dependencies form", e);
         }
     }
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependencyManagementSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependencyManagementSection.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependencyManagementSection.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/DependencyManagementSection.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,96 +60,94 @@ import org.eclipse.ui.forms.widgets.Form
 import org.eclipse.ui.forms.widgets.Hyperlink;
 import org.eclipse.ui.forms.widgets.Section;
 
-
 public class DependencyManagementSection extends SigilSection
 {
 
     private Hyperlink hypConvertRBtoIP;
 
-
-    public DependencyManagementSection( SigilPage page, Composite parent, ISigilProjectModel project )
-        throws CoreException
+    public DependencyManagementSection(SigilPage page, Composite parent, ISigilProjectModel project) throws CoreException
     {
-        super( page, parent, project );
+        super(page, parent, project);
     }
 
-
-    protected void createSection( Section section, FormToolkit toolkit ) throws CoreException
+    protected void createSection(Section section, FormToolkit toolkit)
+        throws CoreException
     {
-        setTitle( "Dependency Management" );
+        setTitle("Dependency Management");
 
-        Composite body = createGridBody( 1, false, toolkit );
+        Composite body = createGridBody(1, false, toolkit);
 
-        hypConvertRBtoIP = toolkit.createHyperlink( body, "Convert Required Bundles to Imported Packages", SWT.NONE );
-        hypConvertRBtoIP.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
+        hypConvertRBtoIP = toolkit.createHyperlink(body,
+            "Convert Required Bundles to Imported Packages", SWT.NONE);
+        hypConvertRBtoIP.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
 
-        hypConvertRBtoIP.addHyperlinkListener( new HyperlinkAdapter()
+        hypConvertRBtoIP.addHyperlinkListener(new HyperlinkAdapter()
         {
-            public void linkActivated( HyperlinkEvent e )
+            public void linkActivated(HyperlinkEvent e)
             {
                 run();
             }
-        } );
+        });
     }
 
-
     protected void run()
     {
         final Map<String, IPackageExport> exports = new HashMap<String, IPackageExport>();
         final Set<String> imports = new HashSet<String>();
 
         // Find all exports
-        final ExportedPackageFinder exportFinder = new ExportedPackageFinder( getProjectModel(),
-            new AccumulatorAdapter<IPackageExport>()
+        final ExportedPackageFinder exportFinder = new ExportedPackageFinder(
+            getProjectModel(), new AccumulatorAdapter<IPackageExport>()
             {
-                public void addElements( Collection<? extends IPackageExport> elements )
+                public void addElements(Collection<? extends IPackageExport> elements)
                 {
-                    for ( IPackageExport export : elements )
+                    for (IPackageExport export : elements)
                     {
-                        exports.put( export.getPackageName(), export );
+                        exports.put(export.getPackageName(), export);
                     }
                 }
-            } );
-        Job findExportsJob = new Job( "Find exports" )
+            });
+        Job findExportsJob = new Job("Find exports")
         {
-            protected IStatus run( IProgressMonitor monitor )
+            protected IStatus run(IProgressMonitor monitor)
             {
-                return exportFinder.run( monitor );
+                return exportFinder.run(monitor);
             }
         };
-        findExportsJob.setUser( true );
+        findExportsJob.setUser(true);
         findExportsJob.schedule();
 
         // Find imports from Java source
-        Job findImportsJob = new Job( "Find imports" )
+        Job findImportsJob = new Job("Find imports")
         {
-            protected IStatus run( IProgressMonitor monitor )
+            protected IStatus run(IProgressMonitor monitor)
             {
                 IJavaProject javaProject = getProjectModel().getJavaModel();
                 try
                 {
                     IPackageFragment[] packages = javaProject.getPackageFragments();
-                    for ( IPackageFragment pkg : packages )
+                    for (IPackageFragment pkg : packages)
                     {
                         ICompilationUnit[] compilationUnits = pkg.getCompilationUnits();
-                        for ( ICompilationUnit compilationUnit : compilationUnits )
+                        for (ICompilationUnit compilationUnit : compilationUnits)
                         {
                             IImportDeclaration[] importDecls = compilationUnit.getImports();
-                            for ( IImportDeclaration importDecl : importDecls )
+                            for (IImportDeclaration importDecl : importDecls)
                             {
-                                imports.add( getPackageName( importDecl ) );
+                                imports.add(getPackageName(importDecl));
                             }
                         }
                     }
                     return Status.OK_STATUS;
                 }
-                catch ( JavaModelException e )
+                catch (JavaModelException e)
                 {
-                    return new Status( IStatus.ERROR, SigilUI.PLUGIN_ID, 0, "Error finding imports", e );
+                    return new Status(IStatus.ERROR, SigilUI.PLUGIN_ID, 0,
+                        "Error finding imports", e);
                 }
             }
         };
-        findImportsJob.setUser( true );
+        findImportsJob.setUser(true);
         findImportsJob.schedule();
 
         // Wait for both jobs to complete
@@ -159,7 +156,7 @@ public class DependencyManagementSection
             findImportsJob.join();
             findExportsJob.join();
         }
-        catch ( InterruptedException e )
+        catch (InterruptedException e)
         {
             // Aborted, just do nothing
             return;
@@ -169,26 +166,26 @@ public class DependencyManagementSection
         IBundleModelElement bundleInfo = getProjectModel().getBundle().getBundleInfo();
         Collection<IPackageImport> existingImports = bundleInfo.getImports();
         Map<String, IPackageImport> existingImportsMap = new HashMap<String, IPackageImport>();
-        for ( IPackageImport existingImport : existingImports )
+        for (IPackageImport existingImport : existingImports)
         {
-            existingImportsMap.put( existingImport.getPackageName(), existingImport );
+            existingImportsMap.put(existingImport.getPackageName(), existingImport);
         }
 
         // Add imports to the bundle
         ModelElementFactory elementFactory = ModelElementFactory.getInstance();
         int count = 0;
-        for ( String pkgImport : imports )
+        for (String pkgImport : imports)
         {
-            IPackageExport export = exports.get( pkgImport );
-            if ( export != null && !existingImportsMap.containsKey( pkgImport ) )
+            IPackageExport export = exports.get(pkgImport);
+            if (export != null && !existingImportsMap.containsKey(pkgImport))
             {
                 VersionRange versionRange = ModelHelper.getDefaultRange(export.getVersion());
-                IPackageImport newImport = elementFactory.newModelElement( IPackageImport.class );
-                newImport.setPackageName( pkgImport );
-                newImport.setVersions( versionRange );
-                newImport.setOptional( false );
+                IPackageImport newImport = elementFactory.newModelElement(IPackageImport.class);
+                newImport.setPackageName(pkgImport);
+                newImport.setVersions(versionRange);
+                newImport.setOptional(false);
 
-                bundleInfo.addImport( newImport );
+                bundleInfo.addImport(newImport);
                 count++;
             }
         }
@@ -196,31 +193,31 @@ public class DependencyManagementSection
         // Remove required bundles
         Collection<IRequiredBundle> requiredBundles = bundleInfo.getRequiredBundles();
         int requiredBundlesSize = requiredBundles.size();
-        for ( IRequiredBundle requiredBundle : requiredBundles )
+        for (IRequiredBundle requiredBundle : requiredBundles)
         {
-            bundleInfo.removeRequiredBundle( requiredBundle );
+            bundleInfo.removeRequiredBundle(requiredBundle);
         }
 
         // Update the editor
-        if ( count + requiredBundlesSize > 0 )
+        if (count + requiredBundlesSize > 0)
         {
             IFormPart[] parts = getPage().getManagedForm().getParts();
-            for ( IFormPart formPart : parts )
+            for (IFormPart formPart : parts)
             {
                 formPart.refresh();
-                ( ( AbstractFormPart ) formPart ).markDirty();
+                ((AbstractFormPart) formPart).markDirty();
             }
         }
 
-        MessageDialog.openInformation( getManagedForm().getForm().getShell(), "Dependency Management", "Removed "
-            + requiredBundlesSize + " required bundle(s) and added " + count + " imported package(s)." );
+        MessageDialog.openInformation(getManagedForm().getForm().getShell(),
+            "Dependency Management", "Removed " + requiredBundlesSize
+                + " required bundle(s) and added " + count + " imported package(s).");
     }
 
-
-    private static String getPackageName( IImportDeclaration decl )
+    private static String getPackageName(IImportDeclaration decl)
     {
         String name = decl.getElementName();
-        int lastDot = name.lastIndexOf( '.' );
-        return name.substring( 0, lastDot );
+        int lastDot = name.lastIndexOf('.');
+        return name.substring(0, lastDot);
     }
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExcludedResourcesFilter.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExcludedResourcesFilter.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExcludedResourcesFilter.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExcludedResourcesFilter.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.HashSet;
 import java.util.Set;
 import java.util.regex.Pattern;
@@ -32,39 +31,35 @@ import org.eclipse.jface.preference.IPre
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 
-
 public class ExcludedResourcesFilter extends ViewerFilter
 {
 
     private final Set<Pattern> exclusionSet = new HashSet<Pattern>();
 
-
     public ExcludedResourcesFilter()
     {
         loadExclusions();
     }
 
-
     public final synchronized void loadExclusions()
     {
         exclusionSet.clear();
         IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
-        String[] exclusions = PrefsUtils.stringToArray( store.getString( SigilCore.DEFAULT_EXCLUDED_RESOURCES ) );
-        for ( String exclusion : exclusions )
+        String[] exclusions = PrefsUtils.stringToArray(store.getString(SigilCore.DEFAULT_EXCLUDED_RESOURCES));
+        for (String exclusion : exclusions)
         {
-            exclusionSet.add( GlobCompiler.compile( exclusion ) );
+            exclusionSet.add(GlobCompiler.compile(exclusion));
         }
     }
 
-
     @Override
-    public synchronized boolean select( Viewer viewer, Object parentElement, Object element )
+    public synchronized boolean select(Viewer viewer, Object parentElement, Object element)
     {
-        IResource file = ( IResource ) element;
+        IResource file = (IResource) element;
         String path = file.getName();
-        for ( Pattern p : exclusionSet )
+        for (Pattern p : exclusionSet)
         {
-            if ( p.matcher( path ).matches() )
+            if (p.matcher(path).matches())
             {
                 return false;
             }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportPackagesSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportPackagesSection.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportPackagesSection.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportPackagesSection.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.Iterator;
 import java.util.List;
 
@@ -48,50 +47,47 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.osgi.framework.Version;
 
-
 public class ExportPackagesSection extends BundleDependencySection
 {
 
-    public ExportPackagesSection( SigilPage page, Composite parent, ISigilProjectModel project ) throws CoreException
+    public ExportPackagesSection(SigilPage page, Composite parent, ISigilProjectModel project) throws CoreException
     {
-        super( page, parent, project );
+        super(page, parent, project);
     }
 
-
     @Override
     protected String getTitle()
     {
         return "Export Packages";
     }
 
-
     @Override
-    protected Label createLabel( Composite parent, FormToolkit toolkit )
+    protected Label createLabel(Composite parent, FormToolkit toolkit)
     {
-        return toolkit.createLabel( parent, "Specify which packages this bundle shares with other bundles." );
+        return toolkit.createLabel(parent,
+            "Specify which packages this bundle shares with other bundles.");
     }
 
-
     @Override
     protected IContentProvider getContentProvider()
     {
         return new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
                 return getBundle().getBundleInfo().getExports().toArray();
             }
         };
     }
 
-
     @Override
     protected void handleAdd()
     {
-        NewPackageExportDialog dialog = ResourcesDialogHelper.createNewExportDialog( getSection().getShell(),
-            "Add Exported Package", null, getProjectModel(), true );
+        NewPackageExportDialog dialog = ResourcesDialogHelper.createNewExportDialog(
+            getSection().getShell(), "Add Exported Package", null, getProjectModel(),
+            true);
 
-        if ( dialog.open() == Window.OK )
+        if (dialog.open() == Window.OK)
         {
             try
             {
@@ -99,12 +95,13 @@ public class ExportPackagesSection exten
                 boolean exportsAdded = false;
 
                 List<IPackageFragment> newPkgFragments = dialog.getSelectedElements();
-                for ( IPackageFragment pkgFragment : newPkgFragments )
+                for (IPackageFragment pkgFragment : newPkgFragments)
                 {
-                    IPackageExport pkgExport = ModelElementFactory.getInstance().newModelElement( IPackageExport.class );
-                    pkgExport.setPackageName( pkgFragment.getElementName() );
-                    pkgExport.setVersion( dialog.getVersion() );
-                    getBundle().getBundleInfo().addExport( pkgExport );
+                    IPackageExport pkgExport = ModelElementFactory.getInstance().newModelElement(
+                        IPackageExport.class);
+                    pkgExport.setPackageName(pkgFragment.getElementName());
+                    pkgExport.setVersion(dialog.getVersion());
+                    getBundle().getBundleInfo().addExport(pkgExport);
 
                     exportsAdded = true;
                 }
@@ -114,106 +111,107 @@ public class ExportPackagesSection exten
 
                 boolean shouldAddImports = OptionalPrompt.optionallyPrompt(
                     SigilCore.PREFERENCES_ADD_IMPORT_FOR_EXPORT, "Add Exports",
-                    "Should corresponding imports be added?", getSection().getShell() );
-                if ( shouldAddImports )
+                    "Should corresponding imports be added?", getSection().getShell());
+                if (shouldAddImports)
                 {
-                    for ( IPackageFragment pkgFragment : newPkgFragments )
+                    for (IPackageFragment pkgFragment : newPkgFragments)
                     {
                         IPackageImport pkgImport = ModelElementFactory.getInstance().newModelElement(
-                            IPackageImport.class );
-                        pkgImport.setPackageName( pkgFragment.getElementName() );
+                            IPackageImport.class);
+                        pkgImport.setPackageName(pkgFragment.getElementName());
                         Version version = dialog.getVersion();
-                        if ( version == null )
+                        if (version == null)
                         {
                             version = getBundle().getVersion();
                         }
                         VersionRange versionRange = ModelHelper.getDefaultRange(version);
-                        pkgImport.setVersions( versionRange );
+                        pkgImport.setVersions(versionRange);
 
-                        getBundle().getBundleInfo().addImport( pkgImport );
+                        getBundle().getBundleInfo().addImport(pkgImport);
 
                         importsAdded = true;
                     }
                 }
 
-                if ( importsAdded )
+                if (importsAdded)
                 {
                     refreshAllPages();
                     markDirty();
                 }
-                else if ( exportsAdded )
+                else if (exportsAdded)
                 {
                     refresh();
                     markDirty();
                 }
             }
-            catch ( ModelElementFactoryException e )
+            catch (ModelElementFactoryException e)
             {
-                SigilCore.error( "Failed to buiild model element for package export", e );
+                SigilCore.error("Failed to buiild model element for package export", e);
             }
         }
     }
 
-
     @SuppressWarnings("unchecked")
     @Override
     protected void handleEdit()
     {
-        IStructuredSelection selection = ( IStructuredSelection ) getSelection();
+        IStructuredSelection selection = (IStructuredSelection) getSelection();
 
         boolean changed = false;
 
-        if ( !selection.isEmpty() )
+        if (!selection.isEmpty())
         {
-            for ( Iterator<IPackageExport> i = selection.iterator(); i.hasNext(); )
+            for (Iterator<IPackageExport> i = selection.iterator(); i.hasNext();)
             {
                 IPackageExport packageExport = i.next();
-                NewPackageExportDialog dialog = ResourcesDialogHelper.createNewExportDialog( getSection().getShell(),
-                    "Edit Imported Package", packageExport, getProjectModel(), false );
-                if ( dialog.open() == Window.OK )
+                NewPackageExportDialog dialog = ResourcesDialogHelper.createNewExportDialog(
+                    getSection().getShell(), "Edit Imported Package", packageExport,
+                    getProjectModel(), false);
+                if (dialog.open() == Window.OK)
                 {
                     changed = true;
                     IPackageFragment pkgFragment = dialog.getSelectedElement();
-                    packageExport.setPackageName( pkgFragment.getElementName() );
-                    packageExport.setVersion( dialog.getVersion() );
+                    packageExport.setPackageName(pkgFragment.getElementName());
+                    packageExport.setVersion(dialog.getVersion());
                 }
             }
         }
 
-        if ( changed )
+        if (changed)
         {
             refresh();
             markDirty();
         }
     }
 
-
     @SuppressWarnings("unchecked")
     @Override
     protected void handleRemoved()
     {
-        IStructuredSelection selection = ( IStructuredSelection ) getSelection();
-        
-        if ( !selection.isEmpty() )
+        IStructuredSelection selection = (IStructuredSelection) getSelection();
+
+        if (!selection.isEmpty())
         {
             boolean importsRemoved = false;
 
-            boolean shouldRemoveImports = OptionalPrompt.optionallyPrompt( 
+            boolean shouldRemoveImports = OptionalPrompt.optionallyPrompt(
                 SigilCore.PREFERENCES_REMOVE_IMPORT_FOR_EXPORT, "Remove Exports",
-                "Should corresponding imports be removed?", getSection().getShell() );
-            
+                "Should corresponding imports be removed?", getSection().getShell());
+
             IBundleModelElement info = getBundle().getBundleInfo();
-            
-            for ( Iterator<IPackageExport> i = selection.iterator(); i.hasNext(); )
+
+            for (Iterator<IPackageExport> i = selection.iterator(); i.hasNext();)
             {
                 IPackageExport pe = i.next();
-                info.removeExport( pe );
-                
+                info.removeExport(pe);
+
                 // Remove corresponding imports (maybe)
-                if (shouldRemoveImports) 
-                {                    
-                    for(IPackageImport pi : info.getImports() ) {
-                        if (pi.getPackageName().equals(pe.getPackageName())) {
+                if (shouldRemoveImports)
+                {
+                    for (IPackageImport pi : info.getImports())
+                    {
+                        if (pi.getPackageName().equals(pe.getPackageName()))
+                        {
                             importsRemoved = true;
                             info.removeImport(pi);
                         }
@@ -221,28 +219,27 @@ public class ExportPackagesSection exten
                 }
             }
 
-            if ( importsRemoved )
+            if (importsRemoved)
             {
                 refreshAllPages();
             }
-            else {
+            else
+            {
                 refresh();
             }
-            
+
             markDirty();
         }
     }
 
-
     /**
      * 
      */
     private void refreshAllPages()
     {
-        ( ( SigilProjectEditorPart ) getPage().getEditor() ).refreshAllPages();
+        ((SigilProjectEditorPart) getPage().getEditor()).refreshAllPages();
     }
 
-
     private ISigilBundle getBundle()
     {
         return getProjectModel().getBundle();

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportsForm.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportsForm.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportsForm.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ExportsForm.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.eclipse.ui.internal.form.SigilPage;
@@ -31,7 +30,6 @@ import org.eclipse.ui.forms.widgets.Scro
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-
 public class ExportsForm extends SigilPage
 {
 
@@ -39,19 +37,17 @@ public class ExportsForm extends SigilPa
 
     private ISigilProjectModel project;
 
-
-    public ExportsForm( FormEditor editor, ISigilProjectModel project )
+    public ExportsForm(FormEditor editor, ISigilProjectModel project)
     {
-        super( editor, PAGE_ID, "Exports" );
+        super(editor, PAGE_ID, "Exports");
         this.project = project;
     }
 
-
     @Override
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent(IManagedForm managedForm)
     {
         ScrolledForm form = managedForm.getForm();
-        form.setText( "Exports" );
+        form.setText("Exports");
 
         Composite body = form.getBody();
         TableWrapLayout layout = new TableWrapLayout();
@@ -62,17 +58,18 @@ public class ExportsForm extends SigilPa
         layout.numColumns = 1;
         layout.horizontalSpacing = 10;
         layout.verticalSpacing = 20;
-        body.setLayout( layout );
-        body.setLayoutData( new TableWrapData( TableWrapData.FILL ) );
+        body.setLayout(layout);
+        body.setLayoutData(new TableWrapData(TableWrapData.FILL));
 
         try
         {
-            ExportPackagesSection exportPackages = new ExportPackagesSection( this, body, project );
-            managedForm.addPart( exportPackages );
+            ExportPackagesSection exportPackages = new ExportPackagesSection(this, body,
+                project);
+            managedForm.addPart(exportPackages);
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to create contents form", e );
+            SigilCore.error("Failed to create contents form", e);
         }
     }
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/GeneralInfoSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/GeneralInfoSection.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/GeneralInfoSection.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/GeneralInfoSection.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.common.model.ModelElementFactory;
 import org.apache.felix.sigil.common.model.eclipse.ISigilBundle;
 import org.apache.felix.sigil.common.model.osgi.IBundleModelElement;
@@ -45,7 +44,6 @@ import org.eclipse.ui.forms.widgets.Sect
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.Version;
 
-
 /**
  * @author dave
  *
@@ -69,200 +67,194 @@ public class GeneralInfoSection extends 
     private SigilFormEntry activatorEntry;
     private SigilFormEntry fragmentHostEntry;
 
-
     /**
      * @param parent
      * @param toolkit
      * @param style
      * @throws CoreException 
      */
-    public GeneralInfoSection( SigilPage page, Composite parent, ISigilProjectModel project ) throws CoreException
+    public GeneralInfoSection(SigilPage page, Composite parent, ISigilProjectModel project) throws CoreException
     {
-        super( page, parent, project );
+        super(page, parent, project);
     }
 
-
-    protected void createSection( Section section, FormToolkit toolkit )
+    protected void createSection(Section section, FormToolkit toolkit)
     {
-        setTitle( "General Information" );
+        setTitle("General Information");
 
-        Composite body = createGridBody( 3, false, toolkit );
+        Composite body = createGridBody(3, false, toolkit);
 
-        Label label = toolkit.createLabel( body, "This section describes general information about this project." );
-        label.setLayoutData( new GridData( SWT.LEFT, SWT.CENTER, true, false, 3, 1 ) );
+        Label label = toolkit.createLabel(body,
+            "This section describes general information about this project.");
+        label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
 
-        symbolicNameEntry = new SigilFormEntry( body, toolkit, "Symbolic Name" );
-        symbolicNameEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        symbolicNameEntry = new SigilFormEntry(body, toolkit, "Symbolic Name");
+        symbolicNameEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                symbolicName = nullIfEmpty( ( String ) form.getValue() );
+                symbolicName = nullIfEmpty((String) form.getValue());
                 checkDirty();
             }
-        } );
+        });
 
-        nameEntry = new SigilFormEntry( body, toolkit, "Name" );
-        nameEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        nameEntry = new SigilFormEntry(body, toolkit, "Name");
+        nameEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                name = nullIfEmpty( ( String ) form.getValue() );
+                name = nullIfEmpty((String) form.getValue());
                 checkDirty();
             }
-        } );
+        });
 
-        descriptionEntry = new SigilFormEntry( body, toolkit, "Description" );
-        descriptionEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        descriptionEntry = new SigilFormEntry(body, toolkit, "Description");
+        descriptionEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                description = nullIfEmpty( ( String ) form.getValue() );
+                description = nullIfEmpty((String) form.getValue());
                 checkDirty();
             }
-        } );
+        });
 
         IFormValueConverter converter = new IFormValueConverter()
         {
-            public String getLabel( Object value )
+            public String getLabel(Object value)
             {
-                Version v = ( Version ) value;
+                Version v = (Version) value;
                 return v.toString();
             }
 
-
-            public Object getValue( String label )
+            public Object getValue(String label)
             {
-                return VersionTable.getVersion( label );
+                return VersionTable.getVersion(label);
             }
         };
 
-        versionEntry = new SigilFormEntry( body, toolkit, "Version", null, converter );
-        versionEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        versionEntry = new SigilFormEntry(body, toolkit, "Version", null, converter);
+        versionEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                version = ( Version ) form.getValue();
+                version = (Version) form.getValue();
                 checkDirty();
             }
-        } );
+        });
 
-        providerEntry = new SigilFormEntry( body, toolkit, "Provider" );
-        providerEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        providerEntry = new SigilFormEntry(body, toolkit, "Provider");
+        providerEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                provider = nullIfEmpty( ( String ) form.getValue() );
+                provider = nullIfEmpty((String) form.getValue());
                 checkDirty();
             }
-        } );
+        });
 
-        activatorEntry = new SigilFormEntry( body, toolkit, "Bundle Activator", "Browse...", null );
-        activatorEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        activatorEntry = new SigilFormEntry(body, toolkit, "Bundle Activator",
+            "Browse...", null);
+        activatorEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                activator = ( String ) form.getValue();
+                activator = (String) form.getValue();
                 checkDirty();
             }
 
-
             @Override
-            public void browseButtonSelected( SigilFormEntry form )
+            public void browseButtonSelected(SigilFormEntry form)
             {
                 BackgroundLoadingSelectionDialog<String> dialog = ResourcesDialogHelper.createClassSelectDialog(
-                    getShell(), "Add Bundle Activator", getProjectModel(), activator, BundleActivator.class.getName() );
+                    getShell(), "Add Bundle Activator", getProjectModel(), activator,
+                    BundleActivator.class.getName());
 
-                if ( dialog.open() == Window.OK )
+                if (dialog.open() == Window.OK)
                 {
-                    form.setValue( dialog.getSelectedElement() );
+                    form.setValue(dialog.getSelectedElement());
                 }
             }
-        } );
+        });
 
         converter = new IFormValueConverter()
         {
-            public String getLabel( Object value )
+            public String getLabel(Object value)
             {
-                IRequiredBundle b = ( IRequiredBundle ) value;
+                IRequiredBundle b = (IRequiredBundle) value;
                 return b == null ? null : b.getSymbolicName() + " " + b.getVersions();
             }
 
-
-            public Object getValue( String label )
+            public Object getValue(String label)
             {
                 return null;
             }
         };
 
-        fragmentHostEntry = new SigilFormEntry( body, toolkit, "Fragment Host", "Browse...", converter );
-        fragmentHostEntry.setFormEntryListener( new SigilFormEntryAdapter()
+        fragmentHostEntry = new SigilFormEntry(body, toolkit, "Fragment Host",
+            "Browse...", converter);
+        fragmentHostEntry.setFormEntryListener(new SigilFormEntryAdapter()
         {
             @Override
-            public void textValueChanged( SigilFormEntry form )
+            public void textValueChanged(SigilFormEntry form)
             {
-                fragmentHost = ( IRequiredBundle ) form.getValue();
+                fragmentHost = (IRequiredBundle) form.getValue();
                 checkDirty();
             }
 
-
             @Override
-            public void browseButtonSelected( SigilFormEntry form )
+            public void browseButtonSelected(SigilFormEntry form)
             {
-                NewResourceSelectionDialog<IBundleModelElement> dialog = ResourcesDialogHelper
-                    .createRequiredBundleDialog( getSection().getShell(), "Add Required Bundle", getProjectModel(),
-                        null, getBundle().getBundleInfo().getRequiredBundles() );
+                NewResourceSelectionDialog<IBundleModelElement> dialog = ResourcesDialogHelper.createRequiredBundleDialog(
+                    getSection().getShell(), "Add Required Bundle", getProjectModel(),
+                    null, getBundle().getBundleInfo().getRequiredBundles());
 
-                if ( dialog.open() == Window.OK )
+                if (dialog.open() == Window.OK)
                 {
-                    IRequiredBundle required = ModelElementFactory.getInstance()
-                        .newModelElement( IRequiredBundle.class );
-                    required.setSymbolicName( dialog.getSelectedName() );
-                    required.setVersions( dialog.getSelectedVersions() );
-                    form.setValue( required );
+                    IRequiredBundle required = ModelElementFactory.getInstance().newModelElement(
+                        IRequiredBundle.class);
+                    required.setSymbolicName(dialog.getSelectedName());
+                    required.setVersions(dialog.getSelectedVersions());
+                    form.setValue(required);
                 }
             }
-        } );
-        fragmentHostEntry.setFreeText( false );
+        });
+        fragmentHostEntry.setFreeText(false);
     }
 
-
-    private static String nullIfEmpty( String value )
+    private static String nullIfEmpty(String value)
     {
-        if ( value.trim().length() == 0 )
+        if (value.trim().length() == 0)
         {
             return null;
         }
         return value;
     }
 
-
     private Shell getShell()
     {
         return getSection().getShell();
     }
 
-
     @Override
-    public void commit( boolean onSave )
+    public void commit(boolean onSave)
     {
-        getBundle().getBundleInfo().setSymbolicName( symbolicName );
-        getBundle().getBundleInfo().setName( name );
-        getBundle().getBundleInfo().setVersion( version );
-        getBundle().getBundleInfo().setDescription( description );
-        getBundle().getBundleInfo().setVendor( provider );
-        getBundle().getBundleInfo().setFragmentHost( fragmentHost );
-        getBundle().getBundleInfo().setActivator( activator );
+        getBundle().getBundleInfo().setSymbolicName(symbolicName);
+        getBundle().getBundleInfo().setName(name);
+        getBundle().getBundleInfo().setVersion(version);
+        getBundle().getBundleInfo().setDescription(description);
+        getBundle().getBundleInfo().setVendor(provider);
+        getBundle().getBundleInfo().setFragmentHost(fragmentHost);
+        getBundle().getBundleInfo().setActivator(activator);
 
-        super.commit( onSave );
+        super.commit(onSave);
     }
 
-
     @Override
     public void refresh()
     {
@@ -274,39 +266,42 @@ public class GeneralInfoSection extends 
         fragmentHost = getProjectModel().getBundle().getBundleInfo().getFragmentHost();
         activator = getProjectModel().getBundle().getBundleInfo().getActivator();
 
-        nameEntry.setValue( name );
-        symbolicNameEntry.setValue( symbolicName );
-        versionEntry.setValue( version );
-        descriptionEntry.setValue( description );
-        providerEntry.setValue( provider );
-        fragmentHostEntry.setValue( fragmentHost );
-        activatorEntry.setValue( activator );
+        nameEntry.setValue(name);
+        symbolicNameEntry.setValue(symbolicName);
+        versionEntry.setValue(version);
+        descriptionEntry.setValue(description);
+        providerEntry.setValue(provider);
+        fragmentHostEntry.setValue(fragmentHost);
+        activatorEntry.setValue(activator);
 
         super.refresh();
     }
 
-
     private void checkDirty()
     {
-        boolean dirty = different( symbolicName, getProjectModel().getBundle().getBundleInfo().getSymbolicName() )
-            || different( name, getProjectModel().getBundle().getBundleInfo().getName() )
-            || different( version, getProjectModel().getBundle().getBundleInfo().getVersion() )
-            || different( description, getProjectModel().getBundle().getBundleInfo().getDescription() )
-            || different( provider, getProjectModel().getBundle().getBundleInfo().getVendor() )
-            || different( fragmentHost, getProjectModel().getBundle().getBundleInfo().getFragmentHost() )
-            || different( activator, getProjectModel().getBundle().getBundleInfo().getActivator() );
+        boolean dirty = different(symbolicName,
+            getProjectModel().getBundle().getBundleInfo().getSymbolicName())
+            || different(name, getProjectModel().getBundle().getBundleInfo().getName())
+            || different(version,
+                getProjectModel().getBundle().getBundleInfo().getVersion())
+            || different(description,
+                getProjectModel().getBundle().getBundleInfo().getDescription())
+            || different(provider,
+                getProjectModel().getBundle().getBundleInfo().getVendor())
+            || different(fragmentHost,
+                getProjectModel().getBundle().getBundleInfo().getFragmentHost())
+            || different(activator,
+                getProjectModel().getBundle().getBundleInfo().getActivator());
 
-        if ( dirty )
+        if (dirty)
             markDirty();
     }
 
-
-    private boolean different( Object val1, Object val2 )
+    private boolean different(Object val1, Object val2)
     {
-        return val1 == null ? val2 != null : !val1.equals( val2 );
+        return val1 == null ? val2 != null : !val1.equals(val2);
     }
 
-
     private ISigilBundle getBundle()
     {
         return getProjectModel().getBundle();

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/IDependencyChecker.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/IDependencyChecker.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/IDependencyChecker.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/IDependencyChecker.java Mon Aug  2 17:08:03 2010
@@ -19,15 +19,12 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.common.model.osgi.IPackageImport;
 import org.apache.felix.sigil.common.model.osgi.IRequiredBundle;
 
-
 public interface IDependencyChecker
 {
-    boolean isSatisfied( IPackageImport packageImport );
-
+    boolean isSatisfied(IPackageImport packageImport);
 
-    boolean isSatisfied( IRequiredBundle requiredBundle );
+    boolean isSatisfied(IRequiredBundle requiredBundle);
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ImportPackagesSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ImportPackagesSection.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ImportPackagesSection.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ImportPackagesSection.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -43,91 +42,85 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
-
 public class ImportPackagesSection extends BundleDependencySection
 {
 
-    public ImportPackagesSection( SigilPage page, Composite parent, ISigilProjectModel project,
-        Set<IModelElement> unresolvedPackages ) throws CoreException
+    public ImportPackagesSection(SigilPage page, Composite parent, ISigilProjectModel project, Set<IModelElement> unresolvedPackages) throws CoreException
     {
-        super( page, parent, project, unresolvedPackages );
+        super(page, parent, project, unresolvedPackages);
     }
 
-
     @Override
     protected String getTitle()
     {
         return "Import Packages";
     }
 
-
     @Override
-    protected Label createLabel( Composite parent, FormToolkit toolkit )
+    protected Label createLabel(Composite parent, FormToolkit toolkit)
     {
-        return toolkit.createLabel( parent, "Specify which packages this bundle imports from other bundles." );
+        return toolkit.createLabel(parent,
+            "Specify which packages this bundle imports from other bundles.");
     }
 
-
     @Override
     protected IContentProvider getContentProvider()
     {
         return new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                ArrayList<IPackageImport> imports = new ArrayList<IPackageImport>( getBundle().getBundleInfo()
-                    .getImports() );
-                Collections.sort( imports, new Comparator<IPackageImport>()
+                ArrayList<IPackageImport> imports = new ArrayList<IPackageImport>(
+                    getBundle().getBundleInfo().getImports());
+                Collections.sort(imports, new Comparator<IPackageImport>()
                 {
-                    public int compare( IPackageImport o1, IPackageImport o2 )
+                    public int compare(IPackageImport o1, IPackageImport o2)
                     {
-                        return o1.getPackageName().compareTo( o2.getPackageName() );
+                        return o1.getPackageName().compareTo(o2.getPackageName());
                     }
-                } );
+                });
                 return imports.toArray();
             }
         };
     }
 
-
     protected ISigilBundle getBundle()
     {
         return getProjectModel().getBundle();
     }
 
-
     @Override
     protected void handleAdd()
     {
         NewResourceSelectionDialog<? extends IPackageModelElement> dialog = ResourcesDialogHelper.createImportDialog(
-            getSection().getShell(), "Add Imported Package", getProjectModel(), null, getBundle().getBundleInfo()
-                .getImports() );
+            getSection().getShell(), "Add Imported Package", getProjectModel(), null,
+            getBundle().getBundleInfo().getImports());
 
-        if ( dialog.open() == Window.OK )
+        if (dialog.open() == Window.OK)
         {
-            IPackageImport pi = ModelElementFactory.getInstance().newModelElement( IPackageImport.class );
-            pi.setPackageName( dialog.getSelectedName() );
-            pi.setVersions( dialog.getSelectedVersions() );
-            pi.setOptional( dialog.isOptional() );
+            IPackageImport pi = ModelElementFactory.getInstance().newModelElement(
+                IPackageImport.class);
+            pi.setPackageName(dialog.getSelectedName());
+            pi.setVersions(dialog.getSelectedVersions());
+            pi.setOptional(dialog.isOptional());
 
-            getBundle().getBundleInfo().addImport( pi );
+            getBundle().getBundleInfo().addImport(pi);
             refresh();
             markDirty();
         }
     }
 
-
     @SuppressWarnings("unchecked")
     @Override
     protected void handleRemoved()
     {
-        IStructuredSelection selection = ( IStructuredSelection ) getSelection();
+        IStructuredSelection selection = (IStructuredSelection) getSelection();
 
-        if ( !selection.isEmpty() )
+        if (!selection.isEmpty())
         {
-            for ( Iterator<IPackageImport> i = selection.iterator(); i.hasNext(); )
+            for (Iterator<IPackageImport> i = selection.iterator(); i.hasNext();)
             {
-                getBundle().getBundleInfo().removeImport( i.next() );
+                getBundle().getBundleInfo().removeImport(i.next());
             }
 
             refresh();
@@ -135,38 +128,38 @@ public class ImportPackagesSection exten
         }
     }
 
-
     @SuppressWarnings("unchecked")
     @Override
     protected void handleEdit()
     {
-        IStructuredSelection selection = ( IStructuredSelection ) getSelection();
+        IStructuredSelection selection = (IStructuredSelection) getSelection();
 
         boolean changed = false;
 
-        if ( !selection.isEmpty() )
+        if (!selection.isEmpty())
         {
-            for ( Iterator<IPackageImport> i = selection.iterator(); i.hasNext(); )
+            for (Iterator<IPackageImport> i = selection.iterator(); i.hasNext();)
             {
                 IPackageImport packageImport = i.next();
-                NewResourceSelectionDialog<? extends IPackageModelElement> dialog = ResourcesDialogHelper
-                    .createImportDialog( getSection().getShell(), "Edit Imported Package", getProjectModel(),
-                        packageImport, getBundle().getBundleInfo().getImports() );
-                if ( dialog.open() == Window.OK )
+                NewResourceSelectionDialog<? extends IPackageModelElement> dialog = ResourcesDialogHelper.createImportDialog(
+                    getSection().getShell(), "Edit Imported Package", getProjectModel(),
+                    packageImport, getBundle().getBundleInfo().getImports());
+                if (dialog.open() == Window.OK)
                 {
                     changed = true;
-                    IPackageImport newImport = ModelElementFactory.getInstance().newModelElement( IPackageImport.class );
-                    newImport.setPackageName( dialog.getSelectedName() );
-                    newImport.setVersions( dialog.getSelectedVersions() );
-                    newImport.setOptional( dialog.isOptional() );
+                    IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(
+                        IPackageImport.class);
+                    newImport.setPackageName(dialog.getSelectedName());
+                    newImport.setVersions(dialog.getSelectedVersions());
+                    newImport.setOptional(dialog.isOptional());
 
-                    getBundle().getBundleInfo().removeImport( packageImport );
-                    getBundle().getBundleInfo().addImport( newImport );
+                    getBundle().getBundleInfo().removeImport(packageImport);
+                    getBundle().getBundleInfo().addImport(newImport);
                 }
             }
         }
 
-        if ( changed )
+        if (changed)
         {
             refresh();
             markDirty();

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewPackageExportDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewPackageExportDialog.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewPackageExportDialog.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewPackageExportDialog.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.util.Comparator;
 
 import org.apache.felix.sigil.common.osgi.VersionTable;
@@ -40,19 +39,17 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.osgi.framework.Version;
 
-
 public class NewPackageExportDialog extends BackgroundLoadingSelectionDialog<IPackageFragment>
 {
 
     private static final IElementDescriptor<IPackageFragment> PKG_FRAGMENT_STRINGIFIER = new IElementDescriptor<IPackageFragment>()
     {
-        public String getLabel( IPackageFragment element )
+        public String getLabel(IPackageFragment element)
         {
-            return getName( element );
+            return getName(element);
         }
 
-
-        public String getName( IPackageFragment element )
+        public String getName(IPackageFragment element)
         {
             return element.getElementName();
         }
@@ -60,122 +57,116 @@ public class NewPackageExportDialog exte
 
     private static final Comparator<IPackageFragment> PKG_FRAGMENT_COMPARATOR = new Comparator<IPackageFragment>()
     {
-        public int compare( IPackageFragment o1, IPackageFragment o2 )
+        public int compare(IPackageFragment o1, IPackageFragment o2)
         {
-            return o1.getElementName().compareTo( o2.getElementName() );
+            return o1.getElementName().compareTo(o2.getElementName());
         }
     };
 
     private Version version = null;
     private String error = null;
-    private Version projectVersion = VersionTable.getVersion( 0, 0, 0 );
+    private Version projectVersion = VersionTable.getVersion(0, 0, 0);
 
     private Button btnInheritBundleVersion;
     private Button btnExplicitVersion;
     private Text txtVersion;
 
-
-    public NewPackageExportDialog( Shell parentShell, boolean multiSelect )
+    public NewPackageExportDialog(Shell parentShell, boolean multiSelect)
     {
-        super( parentShell, "Package:", multiSelect );
-        setDescriptor( PKG_FRAGMENT_STRINGIFIER );
-        setComparator( PKG_FRAGMENT_COMPARATOR );
+        super(parentShell, "Package:", multiSelect);
+        setDescriptor(PKG_FRAGMENT_STRINGIFIER);
+        setComparator(PKG_FRAGMENT_COMPARATOR);
     }
 
-
     @Override
-    protected Control createDialogArea( Composite parent )
+    protected Control createDialogArea(Composite parent)
     {
         // Create controls
-        Composite container = ( Composite ) super.createDialogArea( parent );
-        Composite composite = new Composite( container, SWT.NONE );
+        Composite container = (Composite) super.createDialogArea(parent);
+        Composite composite = new Composite(container, SWT.NONE);
 
-        Group grpVersion = new Group( composite, SWT.NONE );
-        grpVersion.setText( "Version" );
+        Group grpVersion = new Group(composite, SWT.NONE);
+        grpVersion.setText("Version");
 
-        btnInheritBundleVersion = new Button( grpVersion, SWT.RADIO );
-        btnInheritBundleVersion.setText( "Inherit bundle version" );
-        new Label( grpVersion, SWT.NONE ); // Spacer
-        btnExplicitVersion = new Button( grpVersion, SWT.RADIO );
-        btnExplicitVersion.setText( "Fixed version:" );
-        txtVersion = new Text( grpVersion, SWT.BORDER );
+        btnInheritBundleVersion = new Button(grpVersion, SWT.RADIO);
+        btnInheritBundleVersion.setText("Inherit bundle version");
+        new Label(grpVersion, SWT.NONE); // Spacer
+        btnExplicitVersion = new Button(grpVersion, SWT.RADIO);
+        btnExplicitVersion.setText("Fixed version:");
+        txtVersion = new Text(grpVersion, SWT.BORDER);
 
         // Initialize
-        if ( version == null )
+        if (version == null)
         {
-            btnInheritBundleVersion.setSelection( true );
-            txtVersion.setEnabled( false );
-            txtVersion.setText( projectVersion.toString() );
+            btnInheritBundleVersion.setSelection(true);
+            txtVersion.setEnabled(false);
+            txtVersion.setText(projectVersion.toString());
         }
         else
         {
-            btnExplicitVersion.setSelection( true );
-            txtVersion.setEnabled( true );
-            txtVersion.setText( version.toString() );
+            btnExplicitVersion.setSelection(true);
+            txtVersion.setEnabled(true);
+            txtVersion.setText(version.toString());
         }
         updateButtons();
 
         // Listeners
         Listener radioAndTextListener = new Listener()
         {
-            public void handleEvent( Event event )
+            public void handleEvent(Event event)
             {
                 error = null;
-                if ( btnInheritBundleVersion.getSelection() )
+                if (btnInheritBundleVersion.getSelection())
                 {
                     version = null;
-                    txtVersion.setEnabled( false );
+                    txtVersion.setEnabled(false);
                 }
                 else
                 {
-                    txtVersion.setEnabled( true );
+                    txtVersion.setEnabled(true);
                     try
                     {
-                        version = VersionTable.getVersion( txtVersion.getText() );
+                        version = VersionTable.getVersion(txtVersion.getText());
                     }
-                    catch ( IllegalArgumentException e )
+                    catch (IllegalArgumentException e)
                     {
                         error = "Invalid version";
                     }
                 }
-                setErrorMessage( error );
+                setErrorMessage(error);
                 updateButtons();
             }
         };
-        txtVersion.addListener( SWT.Modify, radioAndTextListener );
-        btnInheritBundleVersion.addListener( SWT.Selection, radioAndTextListener );
-        btnExplicitVersion.addListener( SWT.Selection, radioAndTextListener );
+        txtVersion.addListener(SWT.Modify, radioAndTextListener);
+        btnInheritBundleVersion.addListener(SWT.Selection, radioAndTextListener);
+        btnExplicitVersion.addListener(SWT.Selection, radioAndTextListener);
 
         // Layout
-        composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        composite.setLayout( new GridLayout( 1, false ) );
-        grpVersion.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        grpVersion.setLayout( new GridLayout( 2, false ) );
-        txtVersion.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        composite.setLayout(new GridLayout(1, false));
+        grpVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        grpVersion.setLayout(new GridLayout(2, false));
+        txtVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
 
         return container;
     }
 
-
     @Override
     protected boolean canComplete()
     {
         return super.canComplete() && error == null;
     }
 
-
-    public void setProjectVersion( Version projectVersion )
+    public void setProjectVersion(Version projectVersion)
     {
         this.projectVersion = projectVersion;
     }
 
-
-    public void setVersion( Version version )
+    public void setVersion(Version version)
     {
         this.version = version;
     }
 
-
     public Version getVersion()
     {
         return version;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewResourceSelectionDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewResourceSelectionDialog.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewResourceSelectionDialog.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/NewResourceSelectionDialog.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.common.model.osgi.IVersionedModelElement;
 import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.eclipse.model.util.ModelHelper;
@@ -39,7 +38,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.osgi.framework.Version;
 
-
 public class NewResourceSelectionDialog<E extends IVersionedModelElement> extends BackgroundLoadingSelectionDialog<E>
 {
 
@@ -50,138 +48,129 @@ public class NewResourceSelectionDialog<
     private VersionRange selectedVersions = null;
     private boolean optional = false;
 
-
-    public NewResourceSelectionDialog( Shell parentShell, String selectionLabel, boolean multi )
+    public NewResourceSelectionDialog(Shell parentShell, String selectionLabel, boolean multi)
     {
-        super( parentShell, selectionLabel, multi );
+        super(parentShell, selectionLabel, multi);
     }
 
-
-    public void setOptionalEnabled( boolean enabled )
+    public void setOptionalEnabled(boolean enabled)
     {
         optionalEnabled = enabled;
     }
 
-
     @Override
-    protected Control createDialogArea( Composite parent )
+    protected Control createDialogArea(Composite parent)
     {
         // Create controls
-        Composite container = ( Composite ) super.createDialogArea( parent );
-        Composite composite = new Composite( container, SWT.NONE );
+        Composite container = (Composite) super.createDialogArea(parent);
+        Composite composite = new Composite(container, SWT.NONE);
 
-        if ( optionalEnabled )
+        if (optionalEnabled)
         {
-            new Label( composite, SWT.NONE ); //Spacer
-            btnOptional = new Button( composite, SWT.CHECK );
-            btnOptional.setText( "Optional" );
+            new Label(composite, SWT.NONE); //Spacer
+            btnOptional = new Button(composite, SWT.CHECK);
+            btnOptional.setText("Optional");
         }
 
-        Label lblVersionRange = new Label( composite, SWT.NONE );
-        lblVersionRange.setText( "Version Range:" );
-        Group group = new Group( composite, SWT.BORDER );
+        Label lblVersionRange = new Label(composite, SWT.NONE);
+        lblVersionRange.setText("Version Range:");
+        Group group = new Group(composite, SWT.BORDER);
 
-        pnlVersionRange = new VersionRangeComponent( group, SWT.NONE );
+        pnlVersionRange = new VersionRangeComponent(group, SWT.NONE);
 
         // Initialize
-        if ( selectedVersions != null )
+        if (selectedVersions != null)
         {
-            pnlVersionRange.setVersions( selectedVersions );
+            pnlVersionRange.setVersions(selectedVersions);
         }
 
-        if ( optionalEnabled )
+        if (optionalEnabled)
         {
-            btnOptional.setSelection( optional );
+            btnOptional.setSelection(optional);
             updateButtons();
         }
 
         // Hookup Listeners
-        pnlVersionRange.addVersionChangeListener( new VersionsChangeListener()
+        pnlVersionRange.addVersionChangeListener(new VersionsChangeListener()
         {
-            public void versionsChanged( VersionRange range )
+            public void versionsChanged(VersionRange range)
             {
                 selectedVersions = range;
                 updateButtons();
             }
-        } );
-        pnlVersionRange.addValidationListener( new IValidationListener()
+        });
+        pnlVersionRange.addValidationListener(new IValidationListener()
         {
-            public void validationMessage( String message, int level )
+            public void validationMessage(String message, int level)
             {
-                setMessage( message, level );
+                setMessage(message, level);
                 updateButtons();
             }
-        } );
+        });
 
-        if ( optionalEnabled )
+        if (optionalEnabled)
         {
-            btnOptional.addSelectionListener( new SelectionAdapter()
+            btnOptional.addSelectionListener(new SelectionAdapter()
             {
-                public void widgetSelected( SelectionEvent e )
+                public void widgetSelected(SelectionEvent e)
                 {
                     optional = btnOptional.getSelection();
                 }
-            } );
+            });
         }
 
         // Layout
-        composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        GridLayout layout = new GridLayout( 2, false );
+        composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        GridLayout layout = new GridLayout(2, false);
         layout.verticalSpacing = 10;
         layout.horizontalSpacing = 10;
-        composite.setLayout( layout );
+        composite.setLayout(layout);
 
-        lblVersionRange.setLayoutData( new GridData( SWT.LEFT, SWT.TOP, false, false ) );
-        group.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        group.setLayout( new FillLayout() );
+        lblVersionRange.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+        group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        group.setLayout(new FillLayout());
 
         return container;
     }
 
-
     @Override
-    protected void elementSelected( E selection )
+    protected void elementSelected(E selection)
     {
-        if ( selection != null )
+        if (selection != null)
         {
             Version version = selection.getVersion();
             selectedVersions = ModelHelper.getDefaultRange(version);
-            pnlVersionRange.setVersions( selectedVersions );
+            pnlVersionRange.setVersions(selectedVersions);
         }
     }
 
-
     @Override
     protected synchronized boolean canComplete()
     {
         return super.canComplete() && selectedVersions != null;
     }
 
-
     public VersionRange getSelectedVersions()
     {
         return selectedVersions;
     }
 
-
-    public void setVersions( VersionRange versions )
+    public void setVersions(VersionRange versions)
     {
         selectedVersions = versions;
-        if ( pnlVersionRange != null && !pnlVersionRange.isDisposed() )
+        if (pnlVersionRange != null && !pnlVersionRange.isDisposed())
         {
-            pnlVersionRange.setVersions( versions );
+            pnlVersionRange.setVersions(versions);
             updateButtons();
         }
     }
 
-
     public boolean isOptional()
     {
         return optional;
     }
 
-
-    public void setOptional( boolean optional )
+    public void setOptional(boolean optional)
     {
         this.optional = optional;
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/OverviewForm.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/OverviewForm.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/OverviewForm.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/OverviewForm.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.eclipse.ui.internal.form.SigilPage;
@@ -31,7 +30,6 @@ import org.eclipse.ui.forms.widgets.Scro
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-
 /**
  * @author dave
  *
@@ -41,21 +39,19 @@ public class OverviewForm extends SigilP
     public static final String PAGE_ID = "overview";
     private ISigilProjectModel sigil;
 
-
-    public OverviewForm( SigilProjectEditorPart editor, ISigilProjectModel sigil )
+    public OverviewForm(SigilProjectEditorPart editor, ISigilProjectModel sigil)
     {
-        super( editor, PAGE_ID, "Overview" );
+        super(editor, PAGE_ID, "Overview");
         this.sigil = sigil;
     }
 
-
     @Override
-    protected void createFormContent( IManagedForm managedForm )
+    protected void createFormContent(IManagedForm managedForm)
     {
         FormToolkit toolkit = managedForm.getToolkit();
 
         ScrolledForm form = managedForm.getForm();
-        form.setText( "Overview" );
+        form.setText("Overview");
 
         Composite body = form.getBody();
         TableWrapLayout layout = new TableWrapLayout();
@@ -65,28 +61,28 @@ public class OverviewForm extends SigilP
         layout.rightMargin = 10;
         layout.numColumns = 2;
         layout.horizontalSpacing = 10;
-        body.setLayout( layout );
-        body.setLayoutData( new TableWrapData( TableWrapData.FILL ) );
+        body.setLayout(layout);
+        body.setLayoutData(new TableWrapData(TableWrapData.FILL));
 
-        Composite left = toolkit.createComposite( body );
+        Composite left = toolkit.createComposite(body);
         layout = new TableWrapLayout();
         layout.verticalSpacing = 20;
-        left.setLayout( layout );
-        left.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) );
+        left.setLayout(layout);
+        left.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
 
-        Composite right = toolkit.createComposite( body );
+        Composite right = toolkit.createComposite(body);
         layout = new TableWrapLayout();
         layout.verticalSpacing = 20;
-        right.setLayout( layout );
-        right.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) );
+        right.setLayout(layout);
+        right.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
 
         try
         {
-            GeneralInfoSection general = new GeneralInfoSection( this, left, sigil );
-            managedForm.addPart( general );
+            GeneralInfoSection general = new GeneralInfoSection(this, left, sigil);
+            managedForm.addPart(general);
 
-            ContentSummarySection content = new ContentSummarySection( this, right, sigil );
-            managedForm.addPart( content );
+            ContentSummarySection content = new ContentSummarySection(this, right, sigil);
+            managedForm.addPart(content);
 
             // XXX-FELIX
             // commented out due to removal of runtime newton integration
@@ -94,12 +90,12 @@ public class OverviewForm extends SigilP
             //TestingSection testing = new TestingSection(this, right, newton);
             //managedForm.addPart(testing);
 
-            ToolsSection tools = new ToolsSection( this, right, sigil );
-            managedForm.addPart( tools );
+            ToolsSection tools = new ToolsSection(this, right, sigil);
+            managedForm.addPart(tools);
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to create overview form", e );
+            SigilCore.error("Failed to create overview form", e);
         }
     }
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/PackageExportDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/PackageExportDialog.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/PackageExportDialog.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/PackageExportDialog.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import org.apache.felix.sigil.common.osgi.VersionTable;
 import org.eclipse.jface.viewers.IContentProvider;
 import org.eclipse.jface.viewers.ViewerFilter;
@@ -32,57 +31,51 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.osgi.framework.Version;
 
-
 public class PackageExportDialog extends ResourceSelectDialog
 {
 
     private Text versionText;
     private Version version;
 
-
-    public PackageExportDialog( Shell parentShell, String title, IContentProvider content, ViewerFilter filter,
-        Object scope )
+    public PackageExportDialog(Shell parentShell, String title, IContentProvider content, ViewerFilter filter, Object scope)
     {
-        super( parentShell, content, filter, scope, title, "Package Name:", true );
+        super(parentShell, content, filter, scope, title, "Package Name:", true);
     }
 
-
     @Override
-    protected void createCustom( Composite body )
+    protected void createCustom(Composite body)
     {
-        Label l = new Label( body, SWT.NONE );
-        l.setText( "Version:" );
-        versionText = new Text( body, SWT.BORDER );
-        versionText.addKeyListener( new KeyAdapter()
+        Label l = new Label(body, SWT.NONE);
+        l.setText("Version:");
+        versionText = new Text(body, SWT.BORDER);
+        versionText.addKeyListener(new KeyAdapter()
         {
             @Override
-            public void keyReleased( KeyEvent e )
+            public void keyReleased(KeyEvent e)
             {
                 try
                 {
-                    version = VersionTable.getVersion( versionText.getText() );
-                    setErrorMessage( null );
+                    version = VersionTable.getVersion(versionText.getText());
+                    setErrorMessage(null);
                 }
-                catch ( IllegalArgumentException ex )
+                catch (IllegalArgumentException ex)
                 {
-                    setErrorMessage( "Invalid version" );
+                    setErrorMessage("Invalid version");
                 }
             }
-        } );
-        if ( version != null )
+        });
+        if (version != null)
         {
-            versionText.setText( version.toString() );
+            versionText.setText(version.toString());
         }
     }
 
-
     public Version getVersion()
     {
         return version;
     }
 
-
-    public void setVersion( Version version )
+    public void setVersion(Version version)
     {
         this.version = version;
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ProjectLabelProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ProjectLabelProvider.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ProjectLabelProvider.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/editors/project/ProjectLabelProvider.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.editors.project;
 
-
 import java.io.InputStream;
 
 import org.apache.felix.sigil.common.model.eclipse.ISigilBundle;
@@ -40,7 +39,6 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Widget;
 
-
 public class ProjectLabelProvider extends DefaultLabelProvider implements IBaseLabelProvider
 {
 
@@ -48,50 +46,48 @@ public class ProjectLabelProvider extend
     private final ImageRegistry registry;
     private final IDependencyChecker checker;
 
-
-    public ProjectLabelProvider( Widget parent, ImageRegistry registry )
+    public ProjectLabelProvider(Widget parent, ImageRegistry registry)
     {
-        this( parent, registry, null );
+        this(parent, registry, null);
     }
 
-
-    public ProjectLabelProvider( Widget parent, ImageRegistry registry, IDependencyChecker checker )
+    public ProjectLabelProvider(Widget parent, ImageRegistry registry, IDependencyChecker checker)
     {
         this.parent = parent;
         this.registry = registry;
         this.checker = checker;
     }
 
-
-    public Image getImage( Object element )
+    public Image getImage(Object element)
     {
         Image result = null;
-        if ( element instanceof ISigilBundle || element instanceof IRequiredBundle
-            || element instanceof IBundleModelElement )
+        if (element instanceof ISigilBundle || element instanceof IRequiredBundle
+            || element instanceof IBundleModelElement)
         {
             result = findBundle();
         }
-        else if ( element instanceof IPackageImport )
+        else if (element instanceof IPackageImport)
         {
-            if ( checker != null )
+            if (checker != null)
             {
-                result = checker.isSatisfied( ( IPackageImport ) element ) ? findPackage() : findPackageError();
+                result = checker.isSatisfied((IPackageImport) element) ? findPackage()
+                    : findPackageError();
             }
             else
             {
                 result = findPackage();
             }
         }
-        else if ( element instanceof IPackageExport )
+        else if (element instanceof IPackageExport)
         {
             result = findPackage();
         }
-        else if ( element instanceof IPackageFragmentRoot )
+        else if (element instanceof IPackageFragmentRoot)
         {
-            IPackageFragmentRoot root = ( IPackageFragmentRoot ) element;
+            IPackageFragmentRoot root = (IPackageFragmentRoot) element;
             try
             {
-                if ( root.getKind() == IPackageFragmentRoot.K_SOURCE )
+                if (root.getKind() == IPackageFragmentRoot.K_SOURCE)
                 {
                     result = findPackage();
                 }
@@ -100,12 +96,12 @@ public class ProjectLabelProvider extend
                     result = findBundle();
                 }
             }
-            catch ( JavaModelException e )
+            catch (JavaModelException e)
             {
-                SigilCore.error( "Failed to inspect package fragment root", e );
+                SigilCore.error("Failed to inspect package fragment root", e);
             }
         }
-        else if ( element instanceof IClasspathEntry )
+        else if (element instanceof IClasspathEntry)
         {
             result = findPackage();
         }
@@ -113,113 +109,109 @@ public class ProjectLabelProvider extend
         return result;
     }
 
-
-    public String getText( Object element )
+    public String getText(Object element)
     {
-        if ( element instanceof ISigilBundle )
+        if (element instanceof ISigilBundle)
         {
-            ISigilBundle bundle = ( ISigilBundle ) element;
+            ISigilBundle bundle = (ISigilBundle) element;
             return bundle.getBundleInfo().getSymbolicName();
         }
 
-        if ( element instanceof IRequiredBundle )
+        if (element instanceof IRequiredBundle)
         {
-            IRequiredBundle req = ( IRequiredBundle ) element;
+            IRequiredBundle req = (IRequiredBundle) element;
             return req.getSymbolicName() + " " + req.getVersions();
         }
 
-        if ( element instanceof IPackageImport )
+        if (element instanceof IPackageImport)
         {
-            IPackageImport req = ( IPackageImport ) element;
+            IPackageImport req = (IPackageImport) element;
             return req.getPackageName() + " " + req.getVersions();
         }
 
-        if ( element instanceof IPackageExport )
+        if (element instanceof IPackageExport)
         {
-            IPackageExport pe = ( IPackageExport ) element;
+            IPackageExport pe = (IPackageExport) element;
             return pe.getPackageName() + " " + pe.getVersion();
         }
 
-        if ( element instanceof IResource )
+        if (element instanceof IResource)
         {
-            IResource resource = ( IResource ) element;
+            IResource resource = (IResource) element;
             return resource.getName();
         }
 
-        if ( element instanceof IPackageFragment )
+        if (element instanceof IPackageFragment)
         {
-            IPackageFragment f = ( IPackageFragment ) element;
+            IPackageFragment f = (IPackageFragment) element;
             return f.getElementName();
         }
 
-        if ( element instanceof IPackageFragmentRoot )
+        if (element instanceof IPackageFragmentRoot)
         {
-            IPackageFragmentRoot f = ( IPackageFragmentRoot ) element;
+            IPackageFragmentRoot f = (IPackageFragmentRoot) element;
             try
             {
                 return f.getUnderlyingResource().getName();
             }
-            catch ( JavaModelException e )
+            catch (JavaModelException e)
             {
                 return "unknown";
             }
         }
 
-        if ( element instanceof IClasspathEntry )
+        if (element instanceof IClasspathEntry)
         {
-            IClasspathEntry cp = ( IClasspathEntry ) element;
+            IClasspathEntry cp = (IClasspathEntry) element;
             return cp.getPath().toString();
         }
 
         return element.toString();
     }
 
-
     private Image findPackage()
     {
-        Image image = registry.get( "package" );
+        Image image = registry.get("package");
 
-        if ( image == null )
+        if (image == null)
         {
-            image = loadImage( "icons/package_obj.png" );
-            registry.put( "package", image );
+            image = loadImage("icons/package_obj.png");
+            registry.put("package", image);
         }
 
         return image;
     }
 
-
     private Image findPackageError()
     {
-        Image image = registry.get( "package_error" );
-        if ( image == null )
+        Image image = registry.get("package_error");
+        if (image == null)
         {
-            image = loadImage( "icons/package_obj_error.gif" );
-            registry.put( "package_error", image );
+            image = loadImage("icons/package_obj_error.gif");
+            registry.put("package_error", image);
         }
         return image;
     }
 
-
     private Image findBundle()
     {
-        Image image = registry.get( "bundle" );
+        Image image = registry.get("bundle");
 
-        if ( image == null )
+        if (image == null)
         {
-            image = loadImage( "icons/jar_obj.png" );
-            registry.put( "bundle", image );
+            image = loadImage("icons/jar_obj.png");
+            registry.put("bundle", image);
         }
 
         return image;
     }
 
-
-    private Image loadImage( String resource )
+    private Image loadImage(String resource)
     {
-        InputStream in = ProjectLabelProvider.class.getClassLoader().getResourceAsStream( resource );
-        ImageData data = new ImageData( in );
-        return new Image( parent.getDisplay(), data );
+        InputStream in = ProjectLabelProvider.class.getClassLoader().getResourceAsStream(
+            resource);
+        ImageData data = new ImageData(in);
+        return new Image(parent.getDisplay(), data);
     }
 
 }



Mime
View raw message