felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r981604 [18/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/preferences/repository/RepositorySetsView.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetsView.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetsView.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetsView.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -49,7 +48,6 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Table;
 
-
 public class RepositorySetsView
 {
     private static final String DEFAULT = "default";
@@ -62,218 +60,206 @@ public class RepositorySetsView
 
     private RepositoryViewData defaultSet;
 
-
-    public RepositorySetsView( RepositoriesPreferencePage page )
+    public RepositorySetsView(RepositoriesPreferencePage page)
     {
         this.page = page;
     }
 
-
-    public Control createContents( Composite parent )
+    public Control createContents(Composite parent)
     {
         // Create Controls
-        Composite composite = new Composite( parent, SWT.NONE );
+        Composite composite = new Composite(parent, SWT.NONE);
 
-        Table table = new Table( composite, SWT.SINGLE | SWT.BORDER );
+        Table table = new Table(composite, SWT.SINGLE | SWT.BORDER);
 
         // Table Viewer Setup
-        setView = new TableViewer( table );
+        setView = new TableViewer(table);
 
-        setView.setContentProvider( new DefaultTableProvider()
+        setView.setContentProvider(new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                return toArray( inputElement );
+                return toArray(inputElement);
             }
-        } );
+        });
 
-        defaultSet = new RepositoryViewData( DEFAULT, SigilCore.getRepositoryConfiguration().getDefaultRepositorySet()
-            .getRepositories() );
+        defaultSet = new RepositoryViewData(
+            DEFAULT,
+            SigilCore.getRepositoryConfiguration().getDefaultRepositorySet().getRepositories());
 
-        sets.add( defaultSet );
+        sets.add(defaultSet);
 
-        for ( Map.Entry<String, IRepositorySet> e : SigilCore.getRepositoryConfiguration().loadRepositorySets()
-            .entrySet() )
+        for (Map.Entry<String, IRepositorySet> e : SigilCore.getRepositoryConfiguration().loadRepositorySets().entrySet())
         {
             IRepositorySet s = e.getValue();
-            sets.add( new RepositoryViewData( e.getKey(), s.getRepositories() ) );
+            sets.add(new RepositoryViewData(e.getKey(), s.getRepositories()));
         }
 
-        setView.setLabelProvider( new DefaultLabelProvider()
+        setView.setLabelProvider(new DefaultLabelProvider()
         {
-            public Image getImage( Object element )
+            public Image getImage(Object element)
             {
                 return null;
             }
 
-
-            public String getText( Object element )
+            public String getText(Object element)
             {
-                RepositoryViewData data = ( RepositoryViewData ) element;
+                RepositoryViewData data = (RepositoryViewData) element;
                 return data.getName();
             }
-        } );
+        });
 
-        setView.setInput( sets );
+        setView.setInput(sets);
 
         // Layout
-        composite.setLayout( new GridLayout( 2, false ) );
-        table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 1, 6 ) );
+        composite.setLayout(new GridLayout(2, false));
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 6));
 
-        createButtons( composite );
+        createButtons(composite);
 
         return composite;
     }
 
-
-    private void createButtons( final Composite composite )
+    private void createButtons(final Composite composite)
     {
-        final Button add = new Button( composite, SWT.PUSH );
-        add.setText( "Add..." );
-        add.setEnabled( true );
-
-        final Button edit = new Button( composite, SWT.PUSH );
-        edit.setText( "Edit..." );
-        edit.setEnabled( false );
-
-        final Button remove = new Button( composite, SWT.PUSH );
-        remove.setText( "Remove" );
-        remove.setEnabled( false );
+        final Button add = new Button(composite, SWT.PUSH);
+        add.setText("Add...");
+        add.setEnabled(true);
+
+        final Button edit = new Button(composite, SWT.PUSH);
+        edit.setText("Edit...");
+        edit.setEnabled(false);
+
+        final Button remove = new Button(composite, SWT.PUSH);
+        remove.setText("Remove");
+        remove.setEnabled(false);
         // Listeners
-        add.addSelectionListener( new SelectionAdapter()
+        add.addSelectionListener(new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
-                add( composite );
+                add(composite);
             }
-        } );
+        });
 
-        edit.addSelectionListener( new SelectionAdapter()
+        edit.addSelectionListener(new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
-                IStructuredSelection sel = ( IStructuredSelection ) setView.getSelection();
-                edit( composite, sel );
+                IStructuredSelection sel = (IStructuredSelection) setView.getSelection();
+                edit(composite, sel);
             }
-        } );
+        });
 
-        remove.addSelectionListener( new SelectionAdapter()
+        remove.addSelectionListener(new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
-                IStructuredSelection sel = ( IStructuredSelection ) setView.getSelection();
-                remove( sel );
+                IStructuredSelection sel = (IStructuredSelection) setView.getSelection();
+                remove(sel);
             }
-        } );
+        });
 
-        setView.addSelectionChangedListener( new ISelectionChangedListener()
+        setView.addSelectionChangedListener(new ISelectionChangedListener()
         {
-            public void selectionChanged( SelectionChangedEvent event )
+            public void selectionChanged(SelectionChangedEvent event)
             {
                 boolean enabled = !event.getSelection().isEmpty();
-                if ( enabled )
+                if (enabled)
                 {
-                    RepositoryViewData element = ( RepositoryViewData ) ( ( IStructuredSelection ) event.getSelection() )
-                        .getFirstElement();
-                    edit.setEnabled( true );
-                    remove.setEnabled( element != defaultSet );
+                    RepositoryViewData element = (RepositoryViewData) ((IStructuredSelection) event.getSelection()).getFirstElement();
+                    edit.setEnabled(true);
+                    remove.setEnabled(element != defaultSet);
                 }
                 else
                 {
-                    edit.setEnabled( false );
-                    remove.setEnabled( false );
+                    edit.setEnabled(false);
+                    remove.setEnabled(false);
                 }
             }
-        } );
+        });
 
-        add.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false ) );
-        edit.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false ) );
-        remove.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false ) );
+        add.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        edit.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        remove.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
     }
 
-
-    private void add( Control parent )
+    private void add(Control parent)
     {
-        RepositorySetDialog wizard = new RepositorySetDialog( getShell( parent ), getNames() );
-        if ( wizard.open() == Window.OK )
+        RepositorySetDialog wizard = new RepositorySetDialog(getShell(parent), getNames());
+        if (wizard.open() == Window.OK)
         {
-            sets.add( wizard.getData() );
+            sets.add(wizard.getData());
             updated();
         }
     }
 
-
-    private void edit( Control parent, IStructuredSelection sel )
+    private void edit(Control parent, IStructuredSelection sel)
     {
-        RepositoryViewData data = ( RepositoryViewData ) sel.getFirstElement();
-        RepositorySetDialog wizard = new RepositorySetDialog( getShell( parent ), data, data != defaultSet, getNames() );
-        if ( wizard.open() == Window.OK )
+        RepositoryViewData data = (RepositoryViewData) sel.getFirstElement();
+        RepositorySetDialog wizard = new RepositorySetDialog(getShell(parent), data,
+            data != defaultSet, getNames());
+        if (wizard.open() == Window.OK)
         {
-            if ( data != defaultSet )
+            if (data != defaultSet)
             {
-                data.setName( wizard.getData().getName() );
+                data.setName(wizard.getData().getName());
             }
-            data.setRepositories( wizard.getData().getRepositories() );
+            data.setRepositories(wizard.getData().getRepositories());
             updated();
         }
     }
 
-
     private Set<String> getNames()
     {
         HashSet<String> names = new HashSet<String>();
 
-        for ( RepositoryViewData view : sets )
+        for (RepositoryViewData view : sets)
         {
-            if ( view != defaultSet )
+            if (view != defaultSet)
             {
-                names.add( view.getName() );
+                names.add(view.getName());
             }
         }
 
         return names;
     }
 
-
-    private Shell getShell( Control parent )
+    private Shell getShell(Control parent)
     {
         return parent.getShell();
     }
 
-
-    private void remove( IStructuredSelection sel )
+    private void remove(IStructuredSelection sel)
     {
-        if ( sets.remove( sel.getFirstElement() ) )
+        if (sets.remove(sel.getFirstElement()))
         {
             updated();
         }
     }
 
-
     private void updated()
     {
         setView.refresh();
         page.changed();
     }
 
-
     public Map<String, IRepositorySet> getSets()
     {
         HashMap<String, IRepositorySet> ret = new HashMap<String, IRepositorySet>();
 
-        for ( RepositoryViewData data : sets )
+        for (RepositoryViewData data : sets)
         {
-            if ( data != defaultSet )
+            if (data != defaultSet)
             {
-                IRepositorySet set = new RepositorySet( data.getRepositories() );
-                ret.put( data.getName(), set );
+                IRepositorySet set = new RepositorySet(data.getRepositories());
+                ret.put(data.getName(), set);
             }
         }
 
         return ret;
     }
 
-
     public IRepositoryModel[] getDefaultRepositories()
     {
         return defaultSet.getRepositories();

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import java.util.ArrayList;
 import java.util.Iterator;
 
@@ -42,7 +41,6 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 
-
 public class RepositoryTypeSelectionPage extends WizardSelectionPage implements IWizardPage
 {
 
@@ -51,97 +49,92 @@ public class RepositoryTypeSelectionPage
     private TableViewer repositoryView;
     private IRepositoryModel repositoryElement;
 
-
     public RepositoryTypeSelectionPage()
     {
-        super( TITLE );
-        setTitle( TITLE );
+        super(TITLE);
+        setTitle(TITLE);
     }
 
-
-    public void createControl( Composite parent )
+    public void createControl(Composite parent)
     {
-        Composite control = new Composite( parent, SWT.NONE );
+        Composite control = new Composite(parent, SWT.NONE);
 
         // components
-        new Label( control, SWT.NONE ).setText( "Repositories" );
-        Table table = new Table( control, SWT.SINGLE | SWT.BORDER );
+        new Label(control, SWT.NONE).setText("Repositories");
+        Table table = new Table(control, SWT.SINGLE | SWT.BORDER);
 
         // layout
-        control.setLayout( new GridLayout( 1, true ) );
-        table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
+        control.setLayout(new GridLayout(1, true));
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
         // view
-        repositoryView = new TableViewer( table );
-        repositoryView.setLabelProvider( new LabelProvider()
+        repositoryView = new TableViewer(table);
+        repositoryView.setLabelProvider(new LabelProvider()
         {
             @Override
-            public String getText( Object element )
+            public String getText(Object element)
             {
-                IRepositoryType rep = ( IRepositoryType ) element;
+                IRepositoryType rep = (IRepositoryType) element;
                 return rep.getType();
             }
 
-
             @Override
-            public Image getImage( Object element )
+            public Image getImage(Object element)
             {
-                IRepositoryType rep = ( IRepositoryType ) element;
+                IRepositoryType rep = (IRepositoryType) element;
                 return rep.getIcon();
             }
-        } );
+        });
 
-        repositoryView.setContentProvider( new DefaultTableProvider()
+        repositoryView.setContentProvider(new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                return toArray( inputElement );
+                return toArray(inputElement);
             }
-        } );
+        });
 
-        repositoryView.addSelectionChangedListener( new ISelectionChangedListener()
+        repositoryView.addSelectionChangedListener(new ISelectionChangedListener()
         {
-            public void selectionChanged( SelectionChangedEvent event )
+            public void selectionChanged(SelectionChangedEvent event)
             {
-                if ( !event.getSelection().isEmpty() )
+                if (!event.getSelection().isEmpty())
                 {
-                    IStructuredSelection sel = ( IStructuredSelection ) event.getSelection();
-                    IRepositoryType type = ( IRepositoryType ) sel.getFirstElement();
-                    repositoryElement = SigilCore.getRepositoryConfiguration().newRepositoryElement( type );
-                    selectWizardNode( new RepositoryWizardNode( repositoryElement ) );
+                    IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+                    IRepositoryType type = (IRepositoryType) sel.getFirstElement();
+                    repositoryElement = SigilCore.getRepositoryConfiguration().newRepositoryElement(
+                        type);
+                    selectWizardNode(new RepositoryWizardNode(repositoryElement));
                 }
             }
-        } );
+        });
 
-        ArrayList<IRepositoryType> descriptors = new ArrayList<IRepositoryType>( SigilCore.getRepositoryConfiguration()
-            .loadRepositoryTypes() );
+        ArrayList<IRepositoryType> descriptors = new ArrayList<IRepositoryType>(
+            SigilCore.getRepositoryConfiguration().loadRepositoryTypes());
 
-        for ( Iterator<IRepositoryType> i = descriptors.iterator(); i.hasNext(); )
+        for (Iterator<IRepositoryType> i = descriptors.iterator(); i.hasNext();)
         {
-            if ( !i.next().isDynamic() )
+            if (!i.next().isDynamic())
             {
                 i.remove();
             }
         }
 
-        repositoryView.setInput( descriptors );
+        repositoryView.setInput(descriptors);
 
-        setControl( control );
+        setControl(control);
     }
 
-
-    public void selectWizardNode( RepositoryWizardNode node )
+    public void selectWizardNode(RepositoryWizardNode node)
     {
-        setSelectedNode( node );
+        setSelectedNode(node);
     }
 
-
     public RepositoryWizardNode getSelectedWizardNode()
     {
-        return ( RepositoryWizardNode ) getSelectedNode();
+        return (RepositoryWizardNode) getSelectedNode();
     }
 
-
     public IRepositoryModel getRepository()
     {
         return repositoryElement;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryViewData.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryViewData.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryViewData.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryViewData.java Mon Aug  2 17:08:03 2010
@@ -19,42 +19,35 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
 
-
 class RepositoryViewData
 {
     private String name;
     private IRepositoryModel[] reps;
 
-
-    RepositoryViewData( String name, IRepositoryModel[] reps )
+    RepositoryViewData(String name, IRepositoryModel[] reps)
     {
         this.name = name;
         this.reps = reps;
     }
 
-
     String getName()
     {
         return name;
     }
 
-
     IRepositoryModel[] getRepositories()
     {
         return reps;
     }
 
-
-    void setName( String name )
+    void setName(String name)
     {
         this.name = name;
     }
 
-
-    void setRepositories( IRepositoryModel[] reps )
+    void setRepositories(IRepositoryModel[] reps)
     {
         this.reps = reps;
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryWizardNode.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryWizardNode.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryWizardNode.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryWizardNode.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
 import org.apache.felix.sigil.eclipse.ui.wizard.repository.RepositoryWizard;
@@ -28,7 +27,6 @@ import org.eclipse.jface.wizard.IWizard;
 import org.eclipse.jface.wizard.IWizardNode;
 import org.eclipse.swt.graphics.Point;
 
-
 public class RepositoryWizardNode implements IWizardNode
 {
 
@@ -36,53 +34,47 @@ public class RepositoryWizardNode implem
 
     private RepositoryWizard wizard;
 
-
-    public RepositoryWizardNode( IRepositoryModel repository )
+    public RepositoryWizardNode(IRepositoryModel repository)
     {
         this.repository = repository;
     }
 
-
     public void dispose()
     {
-        if ( wizard != null )
+        if (wizard != null)
         {
             wizard.dispose();
             wizard = null;
         }
     }
 
-
     public Point getExtent()
     {
-        return new Point( -1, -1 );
+        return new Point(-1, -1);
     }
 
-
     public IWizard getWizard()
     {
-        if ( wizard == null )
+        if (wizard == null)
         {
             try
             {
-                wizard = WizardHelper.loadWizard( repository.getType() );
-                wizard.init( repository );
+                wizard = WizardHelper.loadWizard(repository.getType());
+                wizard.init(repository);
             }
-            catch ( CoreException e )
+            catch (CoreException e)
             {
-                SigilCore.error( "Failed to create wizard for " + repository.getType(), e );
+                SigilCore.error("Failed to create wizard for " + repository.getType(), e);
             }
         }
         return wizard;
     }
 
-
     public IRepositoryModel getRepository()
     {
         return repository;
     }
 
-
     public boolean isContentCreated()
     {
         return wizard != null;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/WizardHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/WizardHelper.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/WizardHelper.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/WizardHelper.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryType;
 import org.apache.felix.sigil.eclipse.ui.SigilUI;
@@ -31,38 +30,36 @@ import org.eclipse.core.runtime.IExtensi
 import org.eclipse.core.runtime.IExtensionRegistry;
 import org.eclipse.core.runtime.Platform;
 
-
 public class WizardHelper
 {
-    public static RepositoryWizard loadWizard( IRepositoryType type ) throws CoreException
+    public static RepositoryWizard loadWizard(IRepositoryType type) throws CoreException
     {
-        IConfigurationElement e = findWizardConfig( type.getId() );
+        IConfigurationElement e = findWizardConfig(type.getId());
 
-        if ( e == null )
+        if (e == null)
         {
-            throw SigilCore.newCoreException( "No wizard registered for repository " + type, null );
+            throw SigilCore.newCoreException("No wizard registered for repository "
+                + type, null);
         }
 
-        return ( RepositoryWizard ) e.createExecutableExtension( "class" );
+        return (RepositoryWizard) e.createExecutableExtension("class");
     }
 
-
-    public static boolean hasWizard( IRepositoryType type )
+    public static boolean hasWizard(IRepositoryType type)
     {
-        return findWizardConfig( type.getId() ) != null;
+        return findWizardConfig(type.getId()) != null;
     }
 
-
-    private static IConfigurationElement findWizardConfig( String id )
+    private static IConfigurationElement findWizardConfig(String id)
     {
         IExtensionRegistry registry = Platform.getExtensionRegistry();
-        IExtensionPoint p = registry.getExtensionPoint( SigilUI.REPOSITORY_WIZARD_EXTENSION_POINT_ID );
+        IExtensionPoint p = registry.getExtensionPoint(SigilUI.REPOSITORY_WIZARD_EXTENSION_POINT_ID);
 
-        for ( IExtension e : p.getExtensions() )
+        for (IExtension e : p.getExtensions())
         {
-            for ( IConfigurationElement c : e.getConfigurationElements() )
+            for (IConfigurationElement c : e.getConfigurationElements())
             {
-                if ( id.equals( c.getAttribute( "repository" ) ) )
+                if (id.equals(c.getAttribute("repository")))
                 {
                     return c;
                 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportPackageProposal.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportPackageProposal.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportPackageProposal.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportPackageProposal.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.quickfix;
 
-
 import org.apache.felix.sigil.common.model.ModelElementFactory;
 import org.apache.felix.sigil.common.model.ModelElementFactoryException;
 import org.apache.felix.sigil.common.model.osgi.IPackageExport;
@@ -37,84 +36,77 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.ui.actions.WorkspaceModifyOperation;
 
-
 public class ImportPackageProposal implements IJavaCompletionProposal
 {
 
     private IPackageExport e;
     private ISigilProjectModel n;
 
-
-    public ImportPackageProposal( IPackageExport e, ISigilProjectModel n )
+    public ImportPackageProposal(IPackageExport e, ISigilProjectModel n)
     {
         this.e = e;
         this.n = n;
     }
 
-
     public int getRelevance()
     {
         return 100;
     }
 
-
-    public void apply( IDocument document )
+    public void apply(IDocument document)
     {
         try
         {
 
-            final IPackageImport i = ModelElementFactory.getInstance().newModelElement( IPackageImport.class );
-            i.setPackageName( e.getPackageName() );
+            final IPackageImport i = ModelElementFactory.getInstance().newModelElement(
+                IPackageImport.class);
+            i.setPackageName(e.getPackageName());
             VersionRange selectedVersions = ModelHelper.getDefaultRange(e.getVersion());
-            i.setVersions( selectedVersions );
+            i.setVersions(selectedVersions);
 
             WorkspaceModifyOperation op = new WorkspaceModifyOperation()
             {
                 @Override
-                protected void execute( IProgressMonitor monitor ) throws CoreException
+                protected void execute(IProgressMonitor monitor) throws CoreException
                 {
-                    n.getBundle().getBundleInfo().addImport( i );
-                    n.save( monitor );
+                    n.getBundle().getBundleInfo().addImport(i);
+                    n.save(monitor);
                 }
             };
 
-            SigilUI.runWorkspaceOperation( op, null );
+            SigilUI.runWorkspaceOperation(op, null);
         }
-        catch ( ModelElementFactoryException e )
+        catch (ModelElementFactoryException e)
         {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
     }
 
-
     public String getAdditionalProposalInfo()
     {
         return null;
     }
 
-
     public IContextInformation getContextInformation()
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-
     public String getDisplayString()
     {
-        return "Import package " + e.getPackageName() + " version " + e.getVersion() + " to bundle";
+        return "Import package " + e.getPackageName() + " version " + e.getVersion()
+            + " to bundle";
     }
 
-
     public Image getImage()
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-    public Point getSelection( IDocument document )
+    public Point getSelection(IDocument document)
     {
         return null;
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportQuickFixProcessor.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportQuickFixProcessor.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportQuickFixProcessor.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportQuickFixProcessor.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.quickfix;
 
-
 import java.util.ArrayList;
 import java.util.HashMap;
 
@@ -49,17 +48,15 @@ import org.eclipse.jdt.ui.text.java.IJav
 import org.eclipse.jdt.ui.text.java.IProblemLocation;
 import org.eclipse.jdt.ui.text.java.IQuickFixProcessor;
 
-
 @SuppressWarnings("restriction")
 public class ImportQuickFixProcessor implements IQuickFixProcessor
 {
 
     private static final Object SYNC_FLAG = new Object();
 
-
-    public boolean hasCorrections( ICompilationUnit unit, int problemId )
+    public boolean hasCorrections(ICompilationUnit unit, int problemId)
     {
-        switch ( problemId )
+        switch (problemId)
         {
             case IProblem.ImportNotFound:
             case IProblem.ForbiddenReference:
@@ -71,156 +68,158 @@ public class ImportQuickFixProcessor imp
         }
     }
 
-
-    public IJavaCompletionProposal[] getCorrections( IInvocationContext context, IProblemLocation[] locations )
-        throws CoreException
+    public IJavaCompletionProposal[] getCorrections(IInvocationContext context,
+        IProblemLocation[] locations) throws CoreException
     {
         try
         {
             HashMap<Object, IJavaCompletionProposal> results = new HashMap<Object, IJavaCompletionProposal>();
 
-            ISigilProjectModel project = findProject( context );
+            ISigilProjectModel project = findProject(context);
 
-            if ( project != null )
+            if (project != null)
             {
-                for ( int i = 0; i < locations.length; i++ )
+                for (int i = 0; i < locations.length; i++)
                 {
-                    switch ( locations[i].getProblemId() )
+                    switch (locations[i].getProblemId())
                     {
                         case IProblem.ForbiddenReference:
-                            handleImportNotFound( project, context, locations[i], results );
+                            handleImportNotFound(project, context, locations[i], results);
                             break;
                         case IProblem.ImportNotFound:
-                            handleImportNotFound( project, context, locations[i], results );
+                            handleImportNotFound(project, context, locations[i], results);
                             break;
                         case IProblem.IsClassPathCorrect:
-                            handleIsClassPathCorrect( project, context, locations[i], results );
+                            handleIsClassPathCorrect(project, context, locations[i],
+                                results);
                             break;
                         case IProblem.UndefinedType:
-                            handleUndefinedType( project, context, locations[i], results );
+                            handleUndefinedType(project, context, locations[i], results);
                             break;
                         case IProblem.UndefinedName:
-                            handleUndefinedName( project, context, locations[i], results );
+                            handleUndefinedName(project, context, locations[i], results);
                             break;
                     }
                 }
             }
 
-            return ( IJavaCompletionProposal[] ) results.values().toArray( new IJavaCompletionProposal[results.size()] );
+            return (IJavaCompletionProposal[]) results.values().toArray(
+                new IJavaCompletionProposal[results.size()]);
         }
-        catch ( RuntimeException e )
+        catch (RuntimeException e)
         {
             e.printStackTrace();
             throw e;
         }
     }
 
-
-    private void handleUndefinedName( ISigilProjectModel project, IInvocationContext context, IProblemLocation problem,
-        HashMap<Object, IJavaCompletionProposal> results )
+    private void handleUndefinedName(ISigilProjectModel project,
+        IInvocationContext context, IProblemLocation problem,
+        HashMap<Object, IJavaCompletionProposal> results)
     {
-        Name node = findNode( context, problem );
+        Name node = findNode(context, problem);
 
-        if ( node == null )
+        if (node == null)
         {
             return;
         }
-        addSearchResults( node, project, results );
+        addSearchResults(node, project, results);
     }
 
-
-    private void handleIsClassPathCorrect( ISigilProjectModel project, final IInvocationContext context,
-        IProblemLocation problemLocation, final HashMap<Object, IJavaCompletionProposal> results )
+    private void handleIsClassPathCorrect(ISigilProjectModel project,
+        final IInvocationContext context, IProblemLocation problemLocation,
+        final HashMap<Object, IJavaCompletionProposal> results)
     {
-        for ( final String type : problemLocation.getProblemArguments() )
+        for (final String type : problemLocation.getProblemArguments())
         {
-            final String iPackage = type.substring( 0, type.lastIndexOf( "." ) );
+            final String iPackage = type.substring(0, type.lastIndexOf("."));
 
-            for ( IPackageExport pe : JavaHelper.findExportsForPackage( project, iPackage ) )
+            for (IPackageExport pe : JavaHelper.findExportsForPackage(project, iPackage))
             {
-                results.put( type, new ImportPackageProposal( pe, project ) );
+                results.put(type, new ImportPackageProposal(pe, project));
             }
         }
 
-        if ( !results.containsKey( SYNC_FLAG ) )
+        if (!results.containsKey(SYNC_FLAG))
         {
             //results.put( SYNC_FLAG, null);
         }
     }
 
-
-    private void handleUndefinedType( ISigilProjectModel project, IInvocationContext context, IProblemLocation problem,
-        HashMap<Object, IJavaCompletionProposal> results ) throws CoreException
+    private void handleUndefinedType(ISigilProjectModel project,
+        IInvocationContext context, IProblemLocation problem,
+        HashMap<Object, IJavaCompletionProposal> results) throws CoreException
     {
-        Name node = findNode( context, problem );
+        Name node = findNode(context, problem);
 
-        if ( node == null )
+        if (node == null)
         {
             return;
         }
-        addSearchResults( node, project, results );
+        addSearchResults(node, project, results);
     }
 
-
-    private void handleImportNotFound( ISigilProjectModel project, final IInvocationContext context,
-        IProblemLocation location, final HashMap<Object, IJavaCompletionProposal> results ) throws CoreException
+    private void handleImportNotFound(ISigilProjectModel project,
+        final IInvocationContext context, IProblemLocation location,
+        final HashMap<Object, IJavaCompletionProposal> results) throws CoreException
     {
-        ASTNode selectedNode = location.getCoveringNode( context.getASTRoot() );
-        if ( selectedNode == null )
+        ASTNode selectedNode = location.getCoveringNode(context.getASTRoot());
+        if (selectedNode == null)
             return;
 
-        if ( selectedNode instanceof ClassInstanceCreation )
+        if (selectedNode instanceof ClassInstanceCreation)
         {
-            ClassInstanceCreation c = ( ClassInstanceCreation ) selectedNode;
+            ClassInstanceCreation c = (ClassInstanceCreation) selectedNode;
             Type t = c.getType();
-            Name node = findName( t );
-            if ( node != null )
+            Name node = findName(t);
+            if (node != null)
             {
-                addSearchResults( node, project, results );
+                addSearchResults(node, project, results);
             }
         }
         else
         {
-            for ( final String iPackage : readPackage( selectedNode, location ) )
+            for (final String iPackage : readPackage(selectedNode, location))
             {
-                if ( !results.containsKey( iPackage ) )
+                if (!results.containsKey(iPackage))
                 {
-                    for ( IPackageExport pe : JavaHelper.findExportsForPackage( project, iPackage ) )
+                    for (IPackageExport pe : JavaHelper.findExportsForPackage(project,
+                        iPackage))
                     {
-                        results.put( iPackage, new ImportPackageProposal( pe, project ) );
+                        results.put(iPackage, new ImportPackageProposal(pe, project));
                     }
                 }
             }
         }
     }
 
-
-    private void addSearchResults( Name node, ISigilProjectModel project,
-        HashMap<Object, IJavaCompletionProposal> results )
+    private void addSearchResults(Name node, ISigilProjectModel project,
+        HashMap<Object, IJavaCompletionProposal> results)
     {
-        for ( ISearchResult result : SigilSearch.findProviders( node.getFullyQualifiedName(), project, null ) )
+        for (ISearchResult result : SigilSearch.findProviders(
+            node.getFullyQualifiedName(), project, null))
         {
-            if ( project.getBundle().findImport( result.getPackageName() ) == null )
+            if (project.getBundle().findImport(result.getPackageName()) == null)
             {
-                String type = result.getPackageName() + "." + node.getFullyQualifiedName();
-                results.put( type, new ImportSearchResultProposal( SigilUI.getActiveWorkbenchShell(), result, node,
-                    project ) );
+                String type = result.getPackageName() + "."
+                    + node.getFullyQualifiedName();
+                results.put(type, new ImportSearchResultProposal(
+                    SigilUI.getActiveWorkbenchShell(), result, node, project));
             }
         }
     }
 
-
-    private Name findName( Type t )
+    private Name findName(Type t)
     {
-        if ( t.isSimpleType() )
+        if (t.isSimpleType())
         {
-            SimpleType st = ( SimpleType ) t;
+            SimpleType st = (SimpleType) t;
             return st.getName();
         }
-        else if ( t.isArrayType() )
+        else if (t.isArrayType())
         {
-            ArrayType at = ( ArrayType ) t;
-            return findName( at.getElementType() );
+            ArrayType at = (ArrayType) t;
+            return findName(at.getElementType());
         }
         else
         {
@@ -228,41 +227,40 @@ public class ImportQuickFixProcessor imp
         }
     }
 
-
-    private Name findNode( IInvocationContext context, IProblemLocation problem )
+    private Name findNode(IInvocationContext context, IProblemLocation problem)
     {
-        ASTNode selectedNode = problem.getCoveringNode( context.getASTRoot() );
-        if ( selectedNode == null )
+        ASTNode selectedNode = problem.getCoveringNode(context.getASTRoot());
+        if (selectedNode == null)
         {
             return null;
         }
 
-        while ( selectedNode.getLocationInParent() == QualifiedName.NAME_PROPERTY )
+        while (selectedNode.getLocationInParent() == QualifiedName.NAME_PROPERTY)
         {
             selectedNode = selectedNode.getParent();
         }
 
         Name node = null;
 
-        if ( selectedNode instanceof Type )
+        if (selectedNode instanceof Type)
         {
-            node = findName( ( Type ) selectedNode );
+            node = findName((Type) selectedNode);
         }
-        else if ( selectedNode instanceof Name )
+        else if (selectedNode instanceof Name)
         {
-            node = ( Name ) selectedNode;
+            node = (Name) selectedNode;
         }
 
         return node;
     }
 
-
-    private ISigilProjectModel findProject( IInvocationContext context ) throws CoreException
+    private ISigilProjectModel findProject(IInvocationContext context)
+        throws CoreException
     {
         IProject project = context.getCompilationUnit().getJavaProject().getProject();
-        if ( project.hasNature( SigilCore.NATURE_ID ) )
+        if (project.hasNature(SigilCore.NATURE_ID))
         {
-            return SigilCore.create( project );
+            return SigilCore.create(project);
         }
         else
         {
@@ -270,45 +268,46 @@ public class ImportQuickFixProcessor imp
         }
     }
 
-
-    private String[] readPackage( ASTNode selectedNode, IProblemLocation location )
+    private String[] readPackage(ASTNode selectedNode, IProblemLocation location)
     {
         ArrayList<String> packages = new ArrayList<String>();
 
-        ImportDeclaration id = ( ImportDeclaration ) ASTNodes.getParent( selectedNode, ASTNode.IMPORT_DECLARATION );
+        ImportDeclaration id = (ImportDeclaration) ASTNodes.getParent(selectedNode,
+            ASTNode.IMPORT_DECLARATION);
 
-        if ( id == null )
+        if (id == null)
         {
-            MethodInvocation m = ( MethodInvocation ) ASTNodes.getParent( selectedNode, ASTNode.METHOD_INVOCATION );
+            MethodInvocation m = (MethodInvocation) ASTNodes.getParent(selectedNode,
+                ASTNode.METHOD_INVOCATION);
 
-            if ( m != null )
+            if (m != null)
             {
-                packages.add( readPackage( m ) );
-                while ( m.getExpression() != null && m.getExpression() instanceof MethodInvocation )
+                packages.add(readPackage(m));
+                while (m.getExpression() != null
+                    && m.getExpression() instanceof MethodInvocation)
                 {
-                    m = ( MethodInvocation ) m.getExpression();
-                    packages.add( readPackage( m ) );
+                    m = (MethodInvocation) m.getExpression();
+                    packages.add(readPackage(m));
                 }
             }
         }
         else
         {
-            if ( id.isOnDemand() )
+            if (id.isOnDemand())
             {
-                packages.add( id.getName().toString() );
+                packages.add(id.getName().toString());
             }
             else
             {
                 String iStr = id.getName().toString();
-                packages.add( iStr.substring( 0, iStr.lastIndexOf( "." ) ) );
+                packages.add(iStr.substring(0, iStr.lastIndexOf(".")));
             }
         }
 
-        return packages.toArray( new String[packages.size()] );
+        return packages.toArray(new String[packages.size()]);
     }
 
-
-    private String readPackage( MethodInvocation m )
+    private String readPackage(MethodInvocation m)
     {
         return m.resolveMethodBinding().getDeclaringClass().getPackage().getName();
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportSearchResultProposal.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportSearchResultProposal.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportSearchResultProposal.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportSearchResultProposal.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.quickfix;
 
-
 import org.apache.felix.sigil.common.model.ModelElementFactory;
 import org.apache.felix.sigil.common.model.osgi.IPackageExport;
 import org.apache.felix.sigil.common.model.osgi.IPackageImport;
@@ -51,7 +50,6 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.actions.WorkspaceModifyOperation;
 import org.osgi.framework.Version;
 
-
 public class ImportSearchResultProposal implements IJavaCompletionProposal
 {
 
@@ -60,123 +58,124 @@ public class ImportSearchResultProposal 
     private final ISearchResult result;
     private final Shell shell;
 
-
-    public ImportSearchResultProposal( Shell shell, ISearchResult result, Name node, ISigilProjectModel project )
+    public ImportSearchResultProposal(Shell shell, ISearchResult result, Name node, ISigilProjectModel project)
     {
         this.shell = shell;
         this.result = result;
         this.project = project;
-        if ( node != null )
+        if (node != null)
         {
-            CompilationUnit cu = ( CompilationUnit ) ASTNodes.getParent( node, ASTNode.COMPILATION_UNIT );
-            this.fCompilationUnit = ( ICompilationUnit ) cu.getJavaElement();
+            CompilationUnit cu = (CompilationUnit) ASTNodes.getParent(node,
+                ASTNode.COMPILATION_UNIT);
+            this.fCompilationUnit = (ICompilationUnit) cu.getJavaElement();
         }
     }
 
-
     public int getRelevance()
     {
         return 100;
     }
 
-
-    public void apply( IDocument document )
+    public void apply(IDocument document)
     {
         IPackageExport e = result.getExport();
-        if ( result.getExport() == null )
+        if (result.getExport() == null)
         {
-            if ( MessageDialog.openQuestion( shell, "Modify " + result.getProvider().getBundleInfo().getSymbolicName(),
-                result.getPackageName() + " is not exported. Do you want to export it now?" ) )
+            if (MessageDialog.openQuestion(shell, "Modify "
+                + result.getProvider().getBundleInfo().getSymbolicName(),
+                result.getPackageName()
+                    + " is not exported. Do you want to export it now?"))
             {
-                final IPackageExport pe = ModelElementFactory.getInstance().newModelElement( IPackageExport.class );
-                pe.setPackageName( result.getPackageName() );
+                final IPackageExport pe = ModelElementFactory.getInstance().newModelElement(
+                    IPackageExport.class);
+                pe.setPackageName(result.getPackageName());
                 //e.setVersion(version)
-                final ISigilProjectModel mod = result.getProvider().getAncestor( ISigilProjectModel.class );
-                if ( mod == null )
+                final ISigilProjectModel mod = result.getProvider().getAncestor(
+                    ISigilProjectModel.class);
+                if (mod == null)
                 {
-                    throw new IllegalStateException( "Attempt to modify binary package export" );
+                    throw new IllegalStateException(
+                        "Attempt to modify binary package export");
                 }
                 WorkspaceModifyOperation op = new WorkspaceModifyOperation()
                 {
                     @Override
-                    protected void execute( IProgressMonitor monitor ) throws CoreException
+                    protected void execute(IProgressMonitor monitor) throws CoreException
                     {
-                        mod.getBundle().getBundleInfo().addExport( pe );
-                        mod.save( monitor );
+                        mod.getBundle().getBundleInfo().addExport(pe);
+                        mod.save(monitor);
                     }
                 };
 
-                SigilUI.runWorkspaceOperation( op, null );
+                SigilUI.runWorkspaceOperation(op, null);
                 e = pe;
             }
         }
 
-        final IPackageImport i = ModelElementFactory.getInstance().newModelElement( IPackageImport.class );
-        i.setPackageName( e.getPackageName() );
+        final IPackageImport i = ModelElementFactory.getInstance().newModelElement(
+            IPackageImport.class);
+        i.setPackageName(e.getPackageName());
         VersionRange selectedVersions = ModelHelper.getDefaultRange(e.getVersion());
-        i.setVersions( selectedVersions );
+        i.setVersions(selectedVersions);
 
         WorkspaceModifyOperation op = new WorkspaceModifyOperation()
         {
             @Override
-            protected void execute( IProgressMonitor monitor ) throws CoreException
+            protected void execute(IProgressMonitor monitor) throws CoreException
             {
-                project.getBundle().getBundleInfo().addImport( i );
-                project.save( null );
+                project.getBundle().getBundleInfo().addImport(i);
+                project.save(null);
             }
         };
 
-        SigilUI.runWorkspaceOperation( op, null );
+        SigilUI.runWorkspaceOperation(op, null);
         addSourceImport();
     }
 
-
     private void addSourceImport()
     {
         // add import
         try
         {
-            ImportRewrite rewrite = CodeStyleConfiguration.createImportRewrite( fCompilationUnit, true );
-            rewrite.addImport( result.getClassName() );
-            JavaModelUtil.applyEdit( fCompilationUnit, rewrite.rewriteImports( null ), false, null );
+            ImportRewrite rewrite = CodeStyleConfiguration.createImportRewrite(
+                fCompilationUnit, true);
+            rewrite.addImport(result.getClassName());
+            JavaModelUtil.applyEdit(fCompilationUnit, rewrite.rewriteImports(null),
+                false, null);
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to add import", e );
+            SigilCore.error("Failed to add import", e);
         }
     }
 
-
     public String getAdditionalProposalInfo()
     {
         return null;
     }
 
-
     public IContextInformation getContextInformation()
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-
     public String getDisplayString()
     {
         String type = result.getClassName();
-        String loc = result.getExport() == null ? " from " + result.getProvider().getBundleInfo().getSymbolicName()
-            : " version " + result.getExport().getVersion();
+        String loc = result.getExport() == null ? " from "
+            + result.getProvider().getBundleInfo().getSymbolicName() : " version "
+            + result.getExport().getVersion();
         return "Import " + type + loc;
     }
 
-
     public Image getImage()
     {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-    public Point getSelection( IDocument document )
+    public Point getSelection(IDocument document)
     {
         return null;
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportedClassReference.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportedClassReference.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportedClassReference.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/quickfix/ImportedClassReference.java Mon Aug  2 17:08:03 2010
@@ -19,29 +19,24 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.quickfix;
 
-
 import org.apache.felix.sigil.common.model.osgi.IPackageImport;
 
-
 public class ImportedClassReference
 {
     private IPackageImport pi;
     private String type;
 
-
-    public ImportedClassReference( IPackageImport packageImport, String typeName )
+    public ImportedClassReference(IPackageImport packageImport, String typeName)
     {
         this.pi = packageImport;
         this.type = typeName;
     }
 
-
     public IPackageImport getPackageImport()
     {
         return pi;
     }
 
-
     public String getFullType()
     {
         return type;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/BundleActivatorChange.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/BundleActivatorChange.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/BundleActivatorChange.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/BundleActivatorChange.java Mon Aug  2 17:08:03 2010
@@ -75,7 +75,7 @@ public class BundleActivatorChange exten
     public void initializeValidationData(IProgressMonitor monitor)
     {
         // TODO Auto-generated method stub
-        
+
     }
 
     /* (non-Javadoc)

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ExportPackageChange.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ExportPackageChange.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ExportPackageChange.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ExportPackageChange.java Mon Aug  2 17:08:03 2010
@@ -78,17 +78,19 @@ public class ExportPackageChange extends
 
     @Override
     public Change perform(IProgressMonitor progress) throws CoreException
-    {   
-        if (oldExport != null) {
+    {
+        if (oldExport != null)
+        {
             sigil.getBundle().getBundleInfo().removeChild(oldExport);
         }
-        
-        if (newExport != null) {
+
+        if (newExport != null)
+        {
             sigil.getBundle().getBundleInfo().addExport(newExport);
         }
-        
+
         sigil.save(progress);
-        
+
         return new ExportPackageChange(sigil, newExport, oldExport);
     }
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ImportPackageChange.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ImportPackageChange.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ImportPackageChange.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/ImportPackageChange.java Mon Aug  2 17:08:03 2010
@@ -72,16 +72,18 @@ public class ImportPackageChange extends
     @Override
     public Change perform(IProgressMonitor progress) throws CoreException
     {
-        if (oldImport!=null) {
+        if (oldImport != null)
+        {
             sigil.getBundle().getBundleInfo().removeImport(oldImport);
         }
-        
-        if (newImport != null) {
+
+        if (newImport != null)
+        {
             sigil.getBundle().getBundleInfo().addImport(newImport);
         }
-        
+
         sigil.save(progress);
-        
+
         return new ImportPackageChange(sigil, newImport, oldImport);
     }
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MoveActivatorParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MoveActivatorParticipant.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MoveActivatorParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MoveActivatorParticipant.java Mon Aug  2 17:08:03 2010
@@ -47,19 +47,22 @@ public class MoveActivatorParticipant ex
         CheckConditionsContext ctx) throws OperationCanceledException
     {
         RefactoringStatus status = null;
-        if(getArguments().getUpdateReferences()) {
+        if (getArguments().getUpdateReferences())
+        {
             IPackageFragment pf = (IPackageFragment) compilationUnit.getAncestor(IJavaModel.PACKAGE_FRAGMENT);
             String oldName = qualifiedName(pf, compilationUnit.getElementName());
             try
             {
                 ISigilProjectModel sigil = SigilCore.create(compilationUnit.getJavaProject().getProject());
-                if (oldName.equals(sigil.getBundle().getBundleInfo().getActivator())) {
+                if (oldName.equals(sigil.getBundle().getBundleInfo().getActivator()))
+                {
                     IPackageFragment dest = (IPackageFragment) getArguments().getDestination();
                     String newName = qualifiedName(dest, compilationUnit.getElementName());
-                    
+
                     RefactorUtil.touch(ctx, sigil);
                     changes.add(new BundleActivatorChange(sigil, oldName, newName));
-                    status = RefactoringStatus.createInfoStatus("Updating bundle activator from " + oldName + " to " + newName );
+                    status = RefactoringStatus.createInfoStatus("Updating bundle activator from "
+                        + oldName + " to " + newName);
                 }
             }
             catch (CoreException e)
@@ -67,7 +70,7 @@ public class MoveActivatorParticipant ex
                 SigilCore.warn("Failed to update activator", e);
             }
         }
-        
+
         return status;
     }
 
@@ -86,15 +89,16 @@ public class MoveActivatorParticipant ex
     public Change createChange(IProgressMonitor monitor) throws CoreException,
         OperationCanceledException
     {
-        if (changes.isEmpty()) {
+        if (changes.isEmpty())
+        {
             return new NullChange();
         }
-        else 
+        else
         {
             CompositeChange ret = new CompositeChange("Export-Package update");
-            
+
             ret.addAll(changes.toArray(new Change[changes.size()]));
-            
+
             return ret;
         }
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MovePackageParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MovePackageParticipant.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MovePackageParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/MovePackageParticipant.java Mon Aug  2 17:08:03 2010
@@ -52,50 +52,69 @@ public class MovePackageParticipant exte
     public RefactoringStatus checkConditions(IProgressMonitor monitor,
         CheckConditionsContext context) throws OperationCanceledException
     {
-        if (getArguments().getUpdateReferences()) {
+        if (getArguments().getUpdateReferences())
+        {
             try
             {
                 ISigilProjectModel sourceProject = SigilCore.create(packageFragment.getJavaProject().getProject());
                 IPackageFragmentRoot dest = (IPackageFragmentRoot) getArguments().getDestination();
                 ISigilProjectModel destProject = SigilCore.create(dest.getJavaProject().getProject());
-                
+
                 RefactoringStatus status = new RefactoringStatus();
-                if ( !sourceProject.equals(destProject) ) {                    
+                if (!sourceProject.equals(destProject))
+                {
                     RefactorUtil.touch(context, sourceProject);
                     RefactorUtil.touch(context, destProject);
-                    
+
                     final String packageName = packageFragment.getElementName();
-                    IPackageExport oldExport = ModelHelper.findExport(sourceProject, packageName);
-                    
-                    if (oldExport != null) {
-                        IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(IPackageExport.class);
-                        
+                    IPackageExport oldExport = ModelHelper.findExport(sourceProject,
+                        packageName);
+
+                    if (oldExport != null)
+                    {
+                        IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(
+                            IPackageExport.class);
+
                         newExport.setPackageName(oldExport.getPackageName());
                         newExport.setVersion(oldExport.getRawVersion());
-                        
-                        changes.add(new ExportPackageChange(destProject,null, newExport));
-                        changes.add(new ExportPackageChange(sourceProject, oldExport, null));
-                        
-                        status.addWarning("Package " + packageName + " is exported from " + sourceProject.getSymbolicName() + ", this may effect client bundles that use require bundle");
+
+                        changes.add(new ExportPackageChange(destProject, null, newExport));
+                        changes.add(new ExportPackageChange(sourceProject, oldExport,
+                            null));
+
+                        status.addWarning("Package " + packageName + " is exported from "
+                            + sourceProject.getSymbolicName()
+                            + ", this may effect client bundles that use require bundle");
                     }
-                    else {
+                    else
+                    {
                         SubMonitor sub = SubMonitor.convert(monitor);
-                        
-                        Set<String> users = JavaHelper.findLocalPackageUsers(sourceProject, packageName, sub.newChild(100));
-                        Set<String> dependencies = JavaHelper.findLocalPackageDependencies(sourceProject, packageName, sub.newChild(100));
 
-                        if (users.size() > 0 && dependencies.size() > 0) {
-                            status.addWarning("Package " + packageName + " is coupled to " + users + " and " + dependencies + " this may cause a cyclical dependency");
+                        Set<String> users = JavaHelper.findLocalPackageUsers(
+                            sourceProject, packageName, sub.newChild(100));
+                        Set<String> dependencies = JavaHelper.findLocalPackageDependencies(
+                            sourceProject, packageName, sub.newChild(100));
+
+                        if (users.size() > 0 && dependencies.size() > 0)
+                        {
+                            status.addWarning("Package " + packageName
+                                + " is coupled to " + users + " and " + dependencies
+                                + " this may cause a cyclical dependency");
                         }
-                        
-                        if (users.size() > 0) { // attempt to move an API package
-                            IPackageExport newExport = createNewExport(status, destProject, packageName);
+
+                        if (users.size() > 0)
+                        { // attempt to move an API package
+                            IPackageExport newExport = createNewExport(status,
+                                destProject, packageName);
                             createNewImport(status, sourceProject, newExport);
                         }
-                        
-                        if (dependencies.size() > 0){ // moved an impl package
-                            for (String dep : dependencies) {
-                                IPackageExport newExport = createNewExport(status, sourceProject, dep);
+
+                        if (dependencies.size() > 0)
+                        { // moved an impl package
+                            for (String dep : dependencies)
+                            {
+                                IPackageExport newExport = createNewExport(status,
+                                    sourceProject, dep);
                                 createNewImport(status, destProject, newExport);
                             }
                         }
@@ -109,32 +128,36 @@ public class MovePackageParticipant exte
                 throw new OperationCanceledException(e.getMessage());
             }
         }
-        else {
+        else
+        {
             return new RefactoringStatus();
         }
     }
 
-    private void createNewImport(RefactoringStatus status,
-        ISigilProjectModel project, IPackageExport export)
+    private void createNewImport(RefactoringStatus status, ISigilProjectModel project,
+        IPackageExport export)
     {
-        IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(IPackageImport.class);
+        IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(
+            IPackageImport.class);
         newImport.setPackageName(export.getPackageName());
         newImport.setVersions(ModelHelper.getDefaultRange(export.getVersion()));
-        
+
         status.addInfo("Creating new import in " + project.getSymbolicName());
-        changes.add( new ImportPackageChange(project, null, newImport));                            
+        changes.add(new ImportPackageChange(project, null, newImport));
     }
 
     private IPackageExport createNewExport(RefactoringStatus status,
         ISigilProjectModel project, String packageName)
     {
-        IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(IPackageExport.class);                            
-        newExport.setPackageName(packageName);                            
+        IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(
+            IPackageExport.class);
+        newExport.setPackageName(packageName);
         // new export inherits project version by default
         newExport.setVersion(project.getVersion());
-        
-        status.addInfo("Creating new export " + packageName + " in " + project.getSymbolicName());
-        changes.add( new ExportPackageChange(project, null, newExport));
+
+        status.addInfo("Creating new export " + packageName + " in "
+            + project.getSymbolicName());
+        changes.add(new ExportPackageChange(project, null, newExport));
         return newExport;
     }
 
@@ -142,15 +165,16 @@ public class MovePackageParticipant exte
     public Change createChange(IProgressMonitor monitor) throws CoreException,
         OperationCanceledException
     {
-        if (changes.isEmpty()) {
+        if (changes.isEmpty())
+        {
             return new NullChange();
         }
-        else 
+        else
         {
             CompositeChange ret = new CompositeChange("Export-Package update");
-            
+
             ret.addAll(changes.toArray(new Change[changes.size()]));
-            
+
             return ret;
         }
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RefactorUtil.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RefactorUtil.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RefactorUtil.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RefactorUtil.java Mon Aug  2 17:08:03 2010
@@ -35,7 +35,7 @@ class RefactorUtil
     static final void touch(CheckConditionsContext context, ISigilProjectModel sigil)
     {
         ResourceChangeChecker checker = (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class);
-        IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory();        
+        IResourceChangeDescriptionFactory deltaFactory = checker.getDeltaFactory();
         IFile file = sigil.getProject().getFile(SigilCore.SIGIL_PROJECT_FILE);
         deltaFactory.change(file);
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorPackageParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorPackageParticipant.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorPackageParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorPackageParticipant.java Mon Aug  2 17:08:03 2010
@@ -45,19 +45,23 @@ public class RenameActivatorPackageParti
         CheckConditionsContext ctx) throws OperationCanceledException
     {
         RefactoringStatus status = null;
-        if(getArguments().getUpdateReferences()) {
+        if (getArguments().getUpdateReferences())
+        {
             try
             {
                 ISigilProjectModel sigil = SigilCore.create(packageFragment.getJavaProject().getProject());
                 RefactorUtil.touch(ctx, sigil);
-                
+
                 String oldName = sigil.getBundle().getBundleInfo().getActivator();
-                if ( oldName != null ) {
+                if (oldName != null)
+                {
                     String[] parts = splitPackageClass(oldName);
-                    if (parts[0].equals(packageFragment.getElementName())) {
+                    if (parts[0].equals(packageFragment.getElementName()))
+                    {
                         String newName = getArguments().getNewName() + "." + parts[1];
                         changes.add(new BundleActivatorChange(sigil, oldName, newName));
-                        status = RefactoringStatus.createInfoStatus("Updating bundle activator from " + oldName + " to " + newName );
+                        status = RefactoringStatus.createInfoStatus("Updating bundle activator from "
+                            + oldName + " to " + newName);
                     }
                 }
             }
@@ -66,7 +70,7 @@ public class RenameActivatorPackageParti
                 SigilCore.warn("Failed to update activator", e);
             }
         }
-        
+
         return status;
     }
 
@@ -74,11 +78,13 @@ public class RenameActivatorPackageParti
     {
         String[] parts = new String[2];
         int i = className.lastIndexOf('.');
-        if ( i == -1 ) {
+        if (i == -1)
+        {
             parts[0] = "";
             parts[1] = className;
         }
-        else {
+        else
+        {
             parts[0] = className.substring(0, i);
             parts[1] = className.substring(i + 1);
         }
@@ -89,22 +95,23 @@ public class RenameActivatorPackageParti
     public Change createChange(IProgressMonitor monitor) throws CoreException,
         OperationCanceledException
     {
-        if (changes.isEmpty()) {
+        if (changes.isEmpty())
+        {
             return new NullChange();
         }
-        else 
+        else
         {
             CompositeChange ret = new CompositeChange("Export-Package update");
-            
+
             ret.addAll(changes.toArray(new Change[changes.size()]));
-            
+
             return ret;
         }
     }
 
     @Override
     public String getName()
-    {        
+    {
         return "Sigil Rename Activator Package Participant";
     }
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorParticipant.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenameActivatorParticipant.java Mon Aug  2 17:08:03 2010
@@ -47,18 +47,21 @@ public class RenameActivatorParticipant 
         CheckConditionsContext ctx) throws OperationCanceledException
     {
         RefactoringStatus status = null;
-        if(getArguments().getUpdateReferences()) {
+        if (getArguments().getUpdateReferences())
+        {
             IPackageFragment pf = (IPackageFragment) compilationUnit.getAncestor(IJavaModel.PACKAGE_FRAGMENT);
             String oldName = qualifiedName(pf, compilationUnit.getElementName());
             try
             {
                 ISigilProjectModel sigil = SigilCore.create(compilationUnit.getJavaProject().getProject());
-                if (oldName.equals(sigil.getBundle().getBundleInfo().getActivator())) {
+                if (oldName.equals(sigil.getBundle().getBundleInfo().getActivator()))
+                {
                     String newName = qualifiedName(pf, getArguments().getNewName());
-                    
+
                     RefactorUtil.touch(ctx, sigil);
                     changes.add(new BundleActivatorChange(sigil, oldName, newName));
-                    status = RefactoringStatus.createInfoStatus("Updating bundle activator from " + oldName + " to " + newName );
+                    status = RefactoringStatus.createInfoStatus("Updating bundle activator from "
+                        + oldName + " to " + newName);
                 }
             }
             catch (CoreException e)
@@ -66,7 +69,7 @@ public class RenameActivatorParticipant 
                 SigilCore.warn("Failed to update activator", e);
             }
         }
-        
+
         return status;
     }
 
@@ -85,15 +88,16 @@ public class RenameActivatorParticipant 
     public Change createChange(IProgressMonitor monitor) throws CoreException,
         OperationCanceledException
     {
-        if (changes.isEmpty()) {
+        if (changes.isEmpty())
+        {
             return new NullChange();
         }
-        else 
+        else
         {
             CompositeChange ret = new CompositeChange("Export-Package update");
-            
+
             ret.addAll(changes.toArray(new Change[changes.size()]));
-            
+
             return ret;
         }
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenamePackageParticipant.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenamePackageParticipant.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenamePackageParticipant.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/refactor/RenamePackageParticipant.java Mon Aug  2 17:08:03 2010
@@ -49,47 +49,57 @@ public class RenamePackageParticipant ex
     @Override
     public RefactoringStatus checkConditions(IProgressMonitor pm,
         CheckConditionsContext context) throws OperationCanceledException
-    {   
+    {
         RefactoringStatus status = new RefactoringStatus();
-        
-        if (getArguments().getUpdateReferences()) {
+
+        if (getArguments().getUpdateReferences())
+        {
             try
             {
                 ISigilProjectModel sigil = SigilCore.create(packageFragment.getJavaProject().getProject());
                 final String packageName = packageFragment.getElementName();
-                
+
                 SigilCore.log("Rename checkConditions " + packageName);
-                
+
                 IPackageExport oldExport = ModelHelper.findExport(sigil, packageName);
-                
-                if (oldExport != null) {
+
+                if (oldExport != null)
+                {
                     // record change to check if out of sync...
                     RefactorUtil.touch(context, sigil);
-                                
-                    status = RefactoringStatus.createWarningStatus("Package " + packageName + " is exported. Renaming this package may effect bundles outside of this workspace");
-                    SigilCore.log("Export Package " + packageName + " renamed to " + getArguments().getNewName());
-    
-                    IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(IPackageExport.class);
+
+                    status = RefactoringStatus.createWarningStatus("Package "
+                        + packageName
+                        + " is exported. Renaming this package may effect bundles outside of this workspace");
+                    SigilCore.log("Export Package " + packageName + " renamed to "
+                        + getArguments().getNewName());
+
+                    IPackageExport newExport = ModelElementFactory.getInstance().newModelElement(
+                        IPackageExport.class);
                     newExport.setPackageName(getArguments().getNewName());
                     newExport.setVersion(oldExport.getVersion());
-    
-                    changes.add(new ExportPackageChange(sigil, oldExport, newExport));                    
-    
-                    for ( ISigilProjectModel other : SigilCore.getRoot().getProjects() ) {
-                        if ( !sigil.equals(other) ) {
+
+                    changes.add(new ExportPackageChange(sigil, oldExport, newExport));
+
+                    for (ISigilProjectModel other : SigilCore.getRoot().getProjects())
+                    {
+                        if (!sigil.equals(other))
+                        {
                             // record change to check if out of sync...
                             RefactorUtil.touch(context, other);
                         }
-                        changes.add(createImportChange(status, other, oldExport, newExport));
+                        changes.add(createImportChange(status, other, oldExport,
+                            newExport));
                     }
                 }
             }
             catch (CoreException e)
             {
                 SigilCore.warn("Failed to create export package refactor", e);
-                throw new OperationCanceledException("Failed to create export package refactor");
+                throw new OperationCanceledException(
+                    "Failed to create export package refactor");
             }
-        }        
+        }
         return status;
     }
 
@@ -97,15 +107,16 @@ public class RenamePackageParticipant ex
     public Change createChange(IProgressMonitor pm) throws CoreException,
         OperationCanceledException
     {
-        if (changes.isEmpty()) {
+        if (changes.isEmpty())
+        {
             return new NullChange();
         }
-        else 
+        else
         {
             CompositeChange ret = new CompositeChange("Export-Package update");
-            
+
             ret.addAll(changes.toArray(new Change[changes.size()]));
-            
+
             return ret;
         }
     }
@@ -123,24 +134,28 @@ public class RenamePackageParticipant ex
         return true;
     }
 
-    private Change createImportChange(RefactoringStatus status, ISigilProjectModel sigil, IPackageExport oldExport, IPackageExport newExport)
+    private Change createImportChange(RefactoringStatus status, ISigilProjectModel sigil,
+        IPackageExport oldExport, IPackageExport newExport)
     {
         IBundleModelElement info = sigil.getBundle().getBundleInfo();
         Collection<IPackageImport> imports = info.getImports();
-        
-        for (IPackageImport oldImport : imports) {
-            if (oldImport.accepts(oldExport)) {
-                IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(IPackageImport.class);
-                
+
+        for (IPackageImport oldImport : imports)
+        {
+            if (oldImport.accepts(oldExport))
+            {
+                IPackageImport newImport = ModelElementFactory.getInstance().newModelElement(
+                    IPackageImport.class);
+
                 newImport.setPackageName(newExport.getPackageName());
                 newImport.setVersions(oldImport.getVersions());
-                
+
                 status.addInfo(buildImportChangeMsg(sigil, oldImport, newImport));
-                
+
                 return new ImportPackageChange(sigil, oldImport, newImport);
             }
         }
-        
+
         // ok no change
         return new NullChange();
     }
@@ -148,9 +163,10 @@ public class RenamePackageParticipant ex
     private static final String buildImportChangeMsg(ISigilProjectModel sigil,
         IPackageImport oldImport, IPackageImport newImport)
     {
-        return "Updating import " + oldImport.getPackageName() + " version " + oldImport.getVersions() +
-            " to " + newImport.getPackageName() + " version " + newImport.getVersions() +
-            " in project " + sigil.getSymbolicName() + " version " + sigil.getVersion();
+        return "Updating import " + oldImport.getPackageName() + " version "
+            + oldImport.getVersions() + " to " + newImport.getPackageName() + " version "
+            + newImport.getVersions() + " in project " + sigil.getSymbolicName()
+            + " version " + sigil.getVersion();
     }
 
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizard.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizard.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizard.java Mon Aug  2 17:08:03 2010
@@ -19,15 +19,13 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.repository;
 
-
 import org.apache.felix.sigil.eclipse.ui.wizard.repository.RepositoryWizard;
 
-
 public class FileSystemRepositoryWizard extends RepositoryWizard
 {
     @Override
     public void addPages()
     {
-        addPage( new FileSystemRepositoryWizardPage( this ) );
+        addPage(new FileSystemRepositoryWizardPage(this));
     }
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizardPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizardPage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizardPage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/FileSystemRepositoryWizardPage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.repository;
 
-
 import java.io.File;
 
 import org.apache.felix.sigil.eclipse.ui.wizard.repository.RepositoryWizard;
@@ -30,54 +29,51 @@ import org.eclipse.jface.wizard.IWizardP
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 
-
 public class FileSystemRepositoryWizardPage extends RepositoryWizardPage implements IWizardPage
 {
 
     private DirectoryFieldEditor dirEditor;
 
-
-    protected FileSystemRepositoryWizardPage( RepositoryWizard parent )
+    protected FileSystemRepositoryWizardPage(RepositoryWizard parent)
     {
-        super( "File System Repository", parent );
+        super("File System Repository", parent);
     }
 
-
     @Override
     public void createFieldEditors()
     {
-        dirEditor = new DirectoryFieldEditor( "dir", "Directory:", getFieldEditorParent() );
-        dirEditor.getTextControl( getFieldEditorParent() ).addModifyListener( new ModifyListener()
-        {
-            public void modifyText( ModifyEvent e )
+        dirEditor = new DirectoryFieldEditor("dir", "Directory:", getFieldEditorParent());
+        dirEditor.getTextControl(getFieldEditorParent()).addModifyListener(
+            new ModifyListener()
             {
-                checkPageComplete();
-            }
-        } );
+                public void modifyText(ModifyEvent e)
+                {
+                    checkPageComplete();
+                }
+            });
 
-        addField( dirEditor );
-        addField( new BooleanFieldEditor( "recurse", "Recurse:", getFieldEditorParent() ) );
+        addField(dirEditor);
+        addField(new BooleanFieldEditor("recurse", "Recurse:", getFieldEditorParent()));
     }
 
-
     @Override
     protected void checkPageComplete()
     {
         super.checkPageComplete();
-        if ( isPageComplete() )
+        if (isPageComplete())
         {
-            setPageComplete( dirEditor.getStringValue().length() > 0 );
-            if ( isPageComplete() )
+            setPageComplete(dirEditor.getStringValue().length() > 0);
+            if (isPageComplete())
             {
-                if ( new File( dirEditor.getStringValue() ).isDirectory() )
+                if (new File(dirEditor.getStringValue()).isDirectory())
                 {
-                    setPageComplete( true );
-                    setErrorMessage( null );
+                    setPageComplete(true);
+                    setErrorMessage(null);
                 }
                 else
                 {
-                    setPageComplete( false );
-                    setErrorMessage( "Invalid directory" );
+                    setPageComplete(false);
+                    setErrorMessage("Invalid directory");
                 }
             }
         }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/OSGiInstallRepositoryWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/OSGiInstallRepositoryWizard.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/OSGiInstallRepositoryWizard.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/repository/OSGiInstallRepositoryWizard.java Mon Aug  2 17:08:03 2010
@@ -19,15 +19,13 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.repository;
 
-
 import org.apache.felix.sigil.eclipse.ui.wizard.repository.RepositoryWizard;
 
-
 public class OSGiInstallRepositoryWizard extends RepositoryWizard
 {
     @Override
     public void addPages()
     {
-        addPage( new OSGiInstallRepositoryWizardPage( this ) );
+        addPage(new OSGiInstallRepositoryWizardPage(this));
     }
 }



Mime
View raw message