felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r981604 [17/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/ProjectDependentPreferencesPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/ProjectDependentPreferencesPage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/ProjectDependentPreferencesPage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/ProjectDependentPreferencesPage.java Mon Aug  2 17:08:03 2010
@@ -19,33 +19,30 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences;
 
-
 import org.apache.felix.sigil.eclipse.ui.util.ProjectUtils;
 import org.eclipse.jface.preference.PreferencePage;
 
-
 public abstract class ProjectDependentPreferencesPage extends PreferencePage
 {
 
-    public ProjectDependentPreferencesPage( String title )
+    public ProjectDependentPreferencesPage(String title)
     {
-        super( title );
+        super(title);
     }
 
-
     @Override
     public boolean performOk()
     {
-        if ( isDirty() )
+        if (isDirty())
         {
-            return ProjectUtils.runTaskWithRebuildCheck( new Runnable()
+            return ProjectUtils.runTaskWithRebuildCheck(new Runnable()
             {
                 public void run()
                 {
                     doSave();
                 }
 
-            }, getShell() );
+            }, getShell());
         }
         else
         {
@@ -53,9 +50,7 @@ public abstract class ProjectDependentPr
         }
     }
 
-
     protected abstract void doSave();
 
-
     protected abstract boolean isDirty();
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/SigilPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/SigilPreferencePage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/SigilPreferencePage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/SigilPreferencePage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences;
 
-
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.preferences.PromptablePreference;
 import org.eclipse.jface.preference.FieldEditorPreferencePage;
@@ -28,41 +27,42 @@ import org.eclipse.jface.preference.Radi
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
-
 public class SigilPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
 {
 
     @Override
     protected void createFieldEditors()
     {
-        RadioGroupFieldEditor impExpField = new RadioGroupFieldEditor( SigilCore.PREFERENCES_ADD_IMPORT_FOR_EXPORT,
-            "Add Imports for New Exports", 1, new String[][]
-                { new String[]
-                    { "Always (Recommended)", PromptablePreference.Always.toString() }, new String[]
-                    { "Prompt", PromptablePreference.Prompt.toString() }, new String[]
-                    { "Never", PromptablePreference.Never.toString() } }, getFieldEditorParent(), true );
-
-        addField( impExpField );
-
-        RadioGroupFieldEditor rebuildExpField = new RadioGroupFieldEditor( SigilCore.PREFERENCES_REBUILD_PROJECTS,
-            "Rebuild Projects On Install Change", 1, new String[][]
-                { new String[]
-                    { "Always (Recommended)", PromptablePreference.Always.toString() }, new String[]
-                    { "Prompt", PromptablePreference.Prompt.toString() }, new String[]
-                    { "Never", PromptablePreference.Never.toString() } }, getFieldEditorParent(), true );
+        RadioGroupFieldEditor impExpField = new RadioGroupFieldEditor(
+            SigilCore.PREFERENCES_ADD_IMPORT_FOR_EXPORT, "Add Imports for New Exports",
+            1, new String[][] {
+                    new String[] { "Always (Recommended)",
+                            PromptablePreference.Always.toString() },
+                    new String[] { "Prompt", PromptablePreference.Prompt.toString() },
+                    new String[] { "Never", PromptablePreference.Never.toString() } },
+            getFieldEditorParent(), true);
+
+        addField(impExpField);
+
+        RadioGroupFieldEditor rebuildExpField = new RadioGroupFieldEditor(
+            SigilCore.PREFERENCES_REBUILD_PROJECTS, "Rebuild Projects On Install Change",
+            1, new String[][] {
+                    new String[] { "Always (Recommended)",
+                            PromptablePreference.Always.toString() },
+                    new String[] { "Prompt", PromptablePreference.Prompt.toString() },
+                    new String[] { "Never", PromptablePreference.Never.toString() } },
+            getFieldEditorParent(), true);
 
-        addField( rebuildExpField );
+        addField(rebuildExpField);
     }
 
-
     @Override
     protected IPreferenceStore doGetPreferenceStore()
     {
         return SigilCore.getDefault().getPreferenceStore();
     }
 
-
-    public void init( IWorkbench workbench )
+    public void init(IWorkbench workbench)
     {
     }
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/VersionsPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/VersionsPreferencePage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/VersionsPreferencePage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/VersionsPreferencePage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences;
 
-
 import org.apache.felix.sigil.common.osgi.VersionRange;
 import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.common.osgi.VersionTable;
@@ -43,11 +42,11 @@ import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.osgi.framework.Version;
 
-
 public class VersionsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
 {
 
-    private static final Version SAMPLE_VERSION = VersionTable.getVersion( 1, 2, 3, "qualifier" );
+    private static final Version SAMPLE_VERSION = VersionTable.getVersion(1, 2, 3,
+        "qualifier");
 
     private IWorkbench workbench;
 
@@ -74,361 +73,353 @@ public class VersionsPreferencePage exte
     private Version sampleVersion = SAMPLE_VERSION;
     private Version matchVersion = null;
 
-
     public VersionsPreferencePage()
     {
         super();
-        setDescription( "Specify the Lower and Upper bounds for a default version range calculated from a point version, e.g. \"1.2.3.qualifier\"" );
+        setDescription("Specify the Lower and Upper bounds for a default version range calculated from a point version, e.g. \"1.2.3.qualifier\"");
     }
 
-
     @Override
-    protected Control createContents( Composite parent )
+    protected Control createContents(Composite parent)
     {
         // Create controls
-        Composite composite = new Composite( parent, SWT.NONE );
+        Composite composite = new Composite(parent, SWT.NONE);
 
-        Group grpLowerBound = new Group( composite, SWT.NONE );
-        grpLowerBound.setText( "Lower Bound" );
-        btnLowerBoundExact = new Button( grpLowerBound, SWT.RADIO );
-        btnLowerBoundExact.setText( "Exact e.g. [1.2.3.qualifer, ...)" );
-        btnLowerBoundMicro = new Button( grpLowerBound, SWT.RADIO );
-        btnLowerBoundMicro.setText( "Micro e.g. [1.2.3, ...)" );
-        btnLowerBoundMinor = new Button( grpLowerBound, SWT.RADIO );
-        btnLowerBoundMinor.setText( "Minor e.g. [1.2, ...)" );
-        btnLowerBoundMajor = new Button( grpLowerBound, SWT.RADIO );
-        btnLowerBoundMajor.setText( "Major e.g. [1, ...)" );
-        btnLowerBoundAny = new Button( grpLowerBound, SWT.RADIO );
-        btnLowerBoundAny.setText( "Any e.g. [0, ...)" );
-
-        Group grpUpperBound = new Group( composite, SWT.NONE );
-        grpUpperBound.setText( "Upper Bound" );
-
-        btnUpperBoundExact = new Button( grpUpperBound, SWT.RADIO );
-        btnUpperBoundExact.setText( "Exact e.g. [..., 1.2.3.qualifer]" );
-        btnUpperBoundMicro = new Button( grpUpperBound, SWT.RADIO );
-        btnUpperBoundMicro.setText( "Micro e.g. [..., 1.2.4)" );
-        btnUpperBoundMinor = new Button( grpUpperBound, SWT.RADIO );
-        btnUpperBoundMinor.setText( "Minor e.g. [..., 1.3)" );
-        btnUpperBoundMajor = new Button( grpUpperBound, SWT.RADIO );
-        btnUpperBoundMajor.setText( "Major e.g. [..., 2)" );
-        btnUpperBoundAny = new Button( grpUpperBound, SWT.RADIO );
-        btnUpperBoundAny.setText( "Any e.g. [..., \u221e)" );
-
-        Group grpRangeTest = new Group( composite, SWT.NONE );
-        grpRangeTest.setText( "Range Test" );
-        new Label( grpRangeTest, SWT.NONE ).setText( "Sample Input Version: " );
-        txtSampleVersion = new Text( grpRangeTest, SWT.BORDER );
-        new Label( grpRangeTest, SWT.NONE ).setText( "Calculated Version Range: " );
-        lblCalculatedRange = new Label( grpRangeTest, SWT.NONE );
-
-        new Label( grpRangeTest, SWT.NONE ).setText( "Test: " );
-        txtMatchVersion = new Text( grpRangeTest, SWT.BORDER );
-        new Label( grpRangeTest, SWT.NONE ).setText( "Result: " );
-        lblMatchResult = new Label( grpRangeTest, SWT.NONE );
+        Group grpLowerBound = new Group(composite, SWT.NONE);
+        grpLowerBound.setText("Lower Bound");
+        btnLowerBoundExact = new Button(grpLowerBound, SWT.RADIO);
+        btnLowerBoundExact.setText("Exact e.g. [1.2.3.qualifer, ...)");
+        btnLowerBoundMicro = new Button(grpLowerBound, SWT.RADIO);
+        btnLowerBoundMicro.setText("Micro e.g. [1.2.3, ...)");
+        btnLowerBoundMinor = new Button(grpLowerBound, SWT.RADIO);
+        btnLowerBoundMinor.setText("Minor e.g. [1.2, ...)");
+        btnLowerBoundMajor = new Button(grpLowerBound, SWT.RADIO);
+        btnLowerBoundMajor.setText("Major e.g. [1, ...)");
+        btnLowerBoundAny = new Button(grpLowerBound, SWT.RADIO);
+        btnLowerBoundAny.setText("Any e.g. [0, ...)");
+
+        Group grpUpperBound = new Group(composite, SWT.NONE);
+        grpUpperBound.setText("Upper Bound");
+
+        btnUpperBoundExact = new Button(grpUpperBound, SWT.RADIO);
+        btnUpperBoundExact.setText("Exact e.g. [..., 1.2.3.qualifer]");
+        btnUpperBoundMicro = new Button(grpUpperBound, SWT.RADIO);
+        btnUpperBoundMicro.setText("Micro e.g. [..., 1.2.4)");
+        btnUpperBoundMinor = new Button(grpUpperBound, SWT.RADIO);
+        btnUpperBoundMinor.setText("Minor e.g. [..., 1.3)");
+        btnUpperBoundMajor = new Button(grpUpperBound, SWT.RADIO);
+        btnUpperBoundMajor.setText("Major e.g. [..., 2)");
+        btnUpperBoundAny = new Button(grpUpperBound, SWT.RADIO);
+        btnUpperBoundAny.setText("Any e.g. [..., \u221e)");
+
+        Group grpRangeTest = new Group(composite, SWT.NONE);
+        grpRangeTest.setText("Range Test");
+        new Label(grpRangeTest, SWT.NONE).setText("Sample Input Version: ");
+        txtSampleVersion = new Text(grpRangeTest, SWT.BORDER);
+        new Label(grpRangeTest, SWT.NONE).setText("Calculated Version Range: ");
+        lblCalculatedRange = new Label(grpRangeTest, SWT.NONE);
+
+        new Label(grpRangeTest, SWT.NONE).setText("Test: ");
+        txtMatchVersion = new Text(grpRangeTest, SWT.BORDER);
+        new Label(grpRangeTest, SWT.NONE).setText("Result: ");
+        lblMatchResult = new Label(grpRangeTest, SWT.NONE);
 
         // Initialize controls
-        loadPreferences( false );
+        loadPreferences(false);
         updateRadioButtons();
 
-        txtSampleVersion.setText( sampleVersion.toString() );
+        txtSampleVersion.setText(sampleVersion.toString());
         updateCalculatedRange();
 
         // Add listeners
         SelectionListener buttonListener = new SelectionListener()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
                 readRadioButtons();
                 updateCalculatedRange();
             }
 
-
-            public void widgetDefaultSelected( SelectionEvent e )
+            public void widgetDefaultSelected(SelectionEvent e)
             {
                 readRadioButtons();
                 updateCalculatedRange();
             }
         };
-        btnLowerBoundAny.addSelectionListener( buttonListener );
-        btnLowerBoundMajor.addSelectionListener( buttonListener );
-        btnLowerBoundMinor.addSelectionListener( buttonListener );
-        btnLowerBoundMicro.addSelectionListener( buttonListener );
-        btnLowerBoundExact.addSelectionListener( buttonListener );
-
-        btnUpperBoundAny.addSelectionListener( buttonListener );
-        btnUpperBoundMajor.addSelectionListener( buttonListener );
-        btnUpperBoundMinor.addSelectionListener( buttonListener );
-        btnUpperBoundMicro.addSelectionListener( buttonListener );
-        btnUpperBoundExact.addSelectionListener( buttonListener );
+        btnLowerBoundAny.addSelectionListener(buttonListener);
+        btnLowerBoundMajor.addSelectionListener(buttonListener);
+        btnLowerBoundMinor.addSelectionListener(buttonListener);
+        btnLowerBoundMicro.addSelectionListener(buttonListener);
+        btnLowerBoundExact.addSelectionListener(buttonListener);
+
+        btnUpperBoundAny.addSelectionListener(buttonListener);
+        btnUpperBoundMajor.addSelectionListener(buttonListener);
+        btnUpperBoundMinor.addSelectionListener(buttonListener);
+        btnUpperBoundMicro.addSelectionListener(buttonListener);
+        btnUpperBoundExact.addSelectionListener(buttonListener);
 
-        txtSampleVersion.addModifyListener( new ModifyListener()
+        txtSampleVersion.addModifyListener(new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            public void modifyText(ModifyEvent e)
             {
                 try
                 {
-                    sampleVersion = VersionTable.getVersion( txtSampleVersion.getText() );
+                    sampleVersion = VersionTable.getVersion(txtSampleVersion.getText());
                 }
-                catch ( IllegalArgumentException x )
+                catch (IllegalArgumentException x)
                 {
                     sampleVersion = null;
                 }
                 updateCalculatedRange();
             }
-        } );
-        txtMatchVersion.addModifyListener( new ModifyListener()
+        });
+        txtMatchVersion.addModifyListener(new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            public void modifyText(ModifyEvent e)
             {
                 try
                 {
-                    matchVersion = VersionTable.getVersion( txtMatchVersion.getText() );
+                    matchVersion = VersionTable.getVersion(txtMatchVersion.getText());
                 }
-                catch ( IllegalArgumentException x )
+                catch (IllegalArgumentException x)
                 {
                     matchVersion = null;
                 }
                 updateCalculatedRange();
             }
-        } );
+        });
 
         // Layout
-        GridLayout layout = new GridLayout( 1, false );
+        GridLayout layout = new GridLayout(1, false);
         layout.verticalSpacing = 20;
-        composite.setLayout( layout );
+        composite.setLayout(layout);
 
-        grpLowerBound.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) );
-        grpLowerBound.setLayout( new GridLayout( 1, false ) );
+        grpLowerBound.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        grpLowerBound.setLayout(new GridLayout(1, false));
 
-        grpUpperBound.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) );
-        grpUpperBound.setLayout( new GridLayout( 1, false ) );
+        grpUpperBound.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+        grpUpperBound.setLayout(new GridLayout(1, false));
 
-        grpRangeTest.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, true ) );
-        grpRangeTest.setLayout( new GridLayout( 2, false ) );
+        grpRangeTest.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
+        grpRangeTest.setLayout(new GridLayout(2, false));
 
-        txtSampleVersion.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        lblCalculatedRange.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        txtMatchVersion.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        lblMatchResult.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
+        txtSampleVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        lblCalculatedRange.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        txtMatchVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        lblMatchResult.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
 
         return composite;
     }
 
-
-    private void loadPreferences( boolean useDefaults )
+    private void loadPreferences(boolean useDefaults)
     {
         IPreferenceStore prefs = getPreferenceStore();
         String lowerBoundStr;
-        if ( useDefaults )
+        if (useDefaults)
         {
-            lowerBoundStr = prefs.getDefaultString( SigilCore.DEFAULT_VERSION_LOWER_BOUND );
+            lowerBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
         }
         else
         {
-            lowerBoundStr = prefs.getString( SigilCore.DEFAULT_VERSION_LOWER_BOUND );
+            lowerBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_LOWER_BOUND);
         }
 
         String upperBoundStr;
-        if ( useDefaults )
+        if (useDefaults)
         {
-            upperBoundStr = prefs.getDefaultString( SigilCore.DEFAULT_VERSION_UPPER_BOUND );
+            upperBoundStr = prefs.getDefaultString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
         }
         else
         {
-            upperBoundStr = prefs.getString( SigilCore.DEFAULT_VERSION_UPPER_BOUND );
+            upperBoundStr = prefs.getString(SigilCore.DEFAULT_VERSION_UPPER_BOUND);
         }
 
-        lowerBoundRule = VersionRangeBoundingRule.valueOf( lowerBoundStr );
-        upperBoundRule = VersionRangeBoundingRule.valueOf( upperBoundStr );
+        lowerBoundRule = VersionRangeBoundingRule.valueOf(lowerBoundStr);
+        upperBoundRule = VersionRangeBoundingRule.valueOf(upperBoundStr);
     }
 
-
     private void updateRadioButtons()
     {
-        switch ( lowerBoundRule )
+        switch (lowerBoundRule)
         {
             case Exact:
-                btnLowerBoundExact.setSelection( true );
-                btnLowerBoundMicro.setSelection( false );
-                btnLowerBoundMinor.setSelection( false );
-                btnLowerBoundMajor.setSelection( false );
-                btnLowerBoundAny.setSelection( false );
+                btnLowerBoundExact.setSelection(true);
+                btnLowerBoundMicro.setSelection(false);
+                btnLowerBoundMinor.setSelection(false);
+                btnLowerBoundMajor.setSelection(false);
+                btnLowerBoundAny.setSelection(false);
                 break;
             case Micro:
-                btnLowerBoundExact.setSelection( false );
-                btnLowerBoundMicro.setSelection( true );
-                btnLowerBoundMinor.setSelection( false );
-                btnLowerBoundMajor.setSelection( false );
-                btnLowerBoundAny.setSelection( false );
+                btnLowerBoundExact.setSelection(false);
+                btnLowerBoundMicro.setSelection(true);
+                btnLowerBoundMinor.setSelection(false);
+                btnLowerBoundMajor.setSelection(false);
+                btnLowerBoundAny.setSelection(false);
                 break;
             case Minor:
-                btnLowerBoundExact.setSelection( false );
-                btnLowerBoundMicro.setSelection( false );
-                btnLowerBoundMinor.setSelection( true );
-                btnLowerBoundMajor.setSelection( false );
-                btnLowerBoundAny.setSelection( false );
+                btnLowerBoundExact.setSelection(false);
+                btnLowerBoundMicro.setSelection(false);
+                btnLowerBoundMinor.setSelection(true);
+                btnLowerBoundMajor.setSelection(false);
+                btnLowerBoundAny.setSelection(false);
                 break;
             case Major:
-                btnLowerBoundExact.setSelection( false );
-                btnLowerBoundMicro.setSelection( false );
-                btnLowerBoundMinor.setSelection( false );
-                btnLowerBoundMajor.setSelection( true );
-                btnLowerBoundAny.setSelection( false );
+                btnLowerBoundExact.setSelection(false);
+                btnLowerBoundMicro.setSelection(false);
+                btnLowerBoundMinor.setSelection(false);
+                btnLowerBoundMajor.setSelection(true);
+                btnLowerBoundAny.setSelection(false);
                 break;
             case Any:
-                btnLowerBoundExact.setSelection( false );
-                btnLowerBoundMicro.setSelection( false );
-                btnLowerBoundMinor.setSelection( false );
-                btnLowerBoundMajor.setSelection( false );
-                btnLowerBoundAny.setSelection( true );
+                btnLowerBoundExact.setSelection(false);
+                btnLowerBoundMicro.setSelection(false);
+                btnLowerBoundMinor.setSelection(false);
+                btnLowerBoundMajor.setSelection(false);
+                btnLowerBoundAny.setSelection(true);
                 break;
         }
 
-        switch ( upperBoundRule )
+        switch (upperBoundRule)
         {
             case Exact:
-                btnUpperBoundExact.setSelection( true );
-                btnUpperBoundMicro.setSelection( false );
-                btnUpperBoundMinor.setSelection( false );
-                btnUpperBoundMajor.setSelection( false );
-                btnUpperBoundAny.setSelection( false );
+                btnUpperBoundExact.setSelection(true);
+                btnUpperBoundMicro.setSelection(false);
+                btnUpperBoundMinor.setSelection(false);
+                btnUpperBoundMajor.setSelection(false);
+                btnUpperBoundAny.setSelection(false);
                 break;
             case Micro:
-                btnUpperBoundExact.setSelection( false );
-                btnUpperBoundMicro.setSelection( true );
-                btnUpperBoundMinor.setSelection( false );
-                btnUpperBoundMajor.setSelection( false );
-                btnUpperBoundAny.setSelection( false );
+                btnUpperBoundExact.setSelection(false);
+                btnUpperBoundMicro.setSelection(true);
+                btnUpperBoundMinor.setSelection(false);
+                btnUpperBoundMajor.setSelection(false);
+                btnUpperBoundAny.setSelection(false);
                 break;
             case Minor:
-                btnUpperBoundExact.setSelection( false );
-                btnUpperBoundMicro.setSelection( false );
-                btnUpperBoundMinor.setSelection( true );
-                btnUpperBoundMajor.setSelection( false );
-                btnUpperBoundAny.setSelection( false );
+                btnUpperBoundExact.setSelection(false);
+                btnUpperBoundMicro.setSelection(false);
+                btnUpperBoundMinor.setSelection(true);
+                btnUpperBoundMajor.setSelection(false);
+                btnUpperBoundAny.setSelection(false);
                 break;
             case Major:
-                btnUpperBoundExact.setSelection( false );
-                btnUpperBoundMicro.setSelection( false );
-                btnUpperBoundMinor.setSelection( false );
-                btnUpperBoundMajor.setSelection( true );
-                btnUpperBoundAny.setSelection( false );
+                btnUpperBoundExact.setSelection(false);
+                btnUpperBoundMicro.setSelection(false);
+                btnUpperBoundMinor.setSelection(false);
+                btnUpperBoundMajor.setSelection(true);
+                btnUpperBoundAny.setSelection(false);
                 break;
             case Any:
-                btnUpperBoundExact.setSelection( false );
-                btnUpperBoundMicro.setSelection( false );
-                btnUpperBoundMinor.setSelection( false );
-                btnUpperBoundMajor.setSelection( false );
-                btnUpperBoundAny.setSelection( true );
+                btnUpperBoundExact.setSelection(false);
+                btnUpperBoundMicro.setSelection(false);
+                btnUpperBoundMinor.setSelection(false);
+                btnUpperBoundMajor.setSelection(false);
+                btnUpperBoundAny.setSelection(true);
         }
     }
 
-
     private void readRadioButtons()
     {
-        if ( btnLowerBoundExact.getSelection() )
+        if (btnLowerBoundExact.getSelection())
         {
             lowerBoundRule = VersionRangeBoundingRule.Exact;
         }
-        else if ( btnLowerBoundMicro.getSelection() )
+        else if (btnLowerBoundMicro.getSelection())
         {
             lowerBoundRule = VersionRangeBoundingRule.Micro;
         }
-        else if ( btnLowerBoundMinor.getSelection() )
+        else if (btnLowerBoundMinor.getSelection())
         {
             lowerBoundRule = VersionRangeBoundingRule.Minor;
         }
-        else if ( btnLowerBoundMajor.getSelection() )
+        else if (btnLowerBoundMajor.getSelection())
         {
             lowerBoundRule = VersionRangeBoundingRule.Major;
         }
-        else if ( btnLowerBoundAny.getSelection() )
+        else if (btnLowerBoundAny.getSelection())
         {
             lowerBoundRule = VersionRangeBoundingRule.Any;
         }
 
-        if ( btnUpperBoundExact.getSelection() )
+        if (btnUpperBoundExact.getSelection())
         {
             upperBoundRule = VersionRangeBoundingRule.Exact;
         }
-        else if ( btnUpperBoundMicro.getSelection() )
+        else if (btnUpperBoundMicro.getSelection())
         {
             upperBoundRule = VersionRangeBoundingRule.Micro;
         }
-        else if ( btnUpperBoundMinor.getSelection() )
+        else if (btnUpperBoundMinor.getSelection())
         {
             upperBoundRule = VersionRangeBoundingRule.Minor;
         }
-        else if ( btnUpperBoundMajor.getSelection() )
+        else if (btnUpperBoundMajor.getSelection())
         {
             upperBoundRule = VersionRangeBoundingRule.Major;
         }
-        else if ( btnUpperBoundAny.getSelection() )
+        else if (btnUpperBoundAny.getSelection())
         {
             upperBoundRule = VersionRangeBoundingRule.Any;
         }
     }
 
-
     private void updateCalculatedRange()
     {
         VersionRange range;
         String rangeStr;
         String matchResult;
 
-        if ( sampleVersion == null )
+        if (sampleVersion == null)
         {
             range = null;
             rangeStr = "";
         }
         else
         {
-            range = VersionRange.newInstance( sampleVersion, lowerBoundRule, upperBoundRule );
+            range = VersionRange.newInstance(sampleVersion, lowerBoundRule,
+                upperBoundRule);
             rangeStr = range.toString();
         }
-        lblCalculatedRange.setText( rangeStr );
+        lblCalculatedRange.setText(rangeStr);
 
-        if ( matchVersion == null || range == null )
+        if (matchVersion == null || range == null)
         {
             matchResult = "";
         }
         else
         {
-            matchResult = range.contains( matchVersion ) ? "MATCH!" : "No Match";
+            matchResult = range.contains(matchVersion) ? "MATCH!" : "No Match";
         }
-        lblMatchResult.setText( matchResult );
+        lblMatchResult.setText(matchResult);
     }
 
-
-    public void init( IWorkbench workbench )
+    public void init(IWorkbench workbench)
     {
         this.workbench = workbench;
     }
 
-
     @Override
     protected IPreferenceStore doGetPreferenceStore()
     {
         return SigilCore.getDefault().getPreferenceStore();
     }
 
-
     @Override
     public boolean performOk()
     {
-        getPreferenceStore().setValue( SigilCore.DEFAULT_VERSION_LOWER_BOUND, lowerBoundRule.name() );
-        getPreferenceStore().setValue( SigilCore.DEFAULT_VERSION_UPPER_BOUND, upperBoundRule.name() );
+        getPreferenceStore().setValue(SigilCore.DEFAULT_VERSION_LOWER_BOUND,
+            lowerBoundRule.name());
+        getPreferenceStore().setValue(SigilCore.DEFAULT_VERSION_UPPER_BOUND,
+            upperBoundRule.name());
 
         return true;
     }
 
-
     @Override
     protected void performDefaults()
     {
         super.performDefaults();
-        loadPreferences( true );
+        loadPreferences(true);
         updateRadioButtons();
         updateCalculatedRange();
     }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/installs/OSGiInstallsPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/installs/OSGiInstallsPreferencePage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/installs/OSGiInstallsPreferencePage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/installs/OSGiInstallsPreferencePage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.installs;
 
-
 import java.util.HashMap;
 import java.util.UUID;
 
@@ -53,7 +52,6 @@ import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
-
 public class OSGiInstallsPreferencePage extends ProjectDependentPreferencesPage implements IWorkbenchPreferencePage
 {
 
@@ -63,19 +61,17 @@ public class OSGiInstallsPreferencePage 
         private String location;
         private IOSGiInstallType type;
 
-
-        private Install( String id, String location )
+        private Install(String id, String location)
         {
             this.id = id;
             this.location = location;
         }
 
-
         private IOSGiInstallType getType()
         {
-            if ( type == null )
+            if (type == null)
             {
-                type = SigilCore.getInstallManager().findInstallType( location );
+                type = SigilCore.getInstallManager().findInstallType(location);
             }
             return type;
         }
@@ -85,24 +81,21 @@ public class OSGiInstallsPreferencePage 
     private CheckboxTableViewer viewer;
     private boolean changed;
 
-
     public OSGiInstallsPreferencePage()
     {
-        super( "OSGi Installs" );
+        super("OSGi Installs");
     }
 
-
-    public void init( IWorkbench workbench )
+    public void init(IWorkbench workbench)
     {
     }
 
-
     @Override
-    protected Control createContents( Composite parent )
+    protected Control createContents(Composite parent)
     {
-        Composite control = new Composite( parent, SWT.NONE );
+        Composite control = new Composite(parent, SWT.NONE);
 
-        buildComponents( control );
+        buildComponents(control);
 
         load();
 
@@ -111,79 +104,77 @@ public class OSGiInstallsPreferencePage 
         return control;
     }
 
-
     @Override
     protected boolean isDirty()
     {
         return changed;
     }
 
-
-    private void buildComponents( Composite control )
+    private void buildComponents(Composite control)
     {
-        new Label( control, SWT.NONE ).setText( "Installs:" );
-        new Label( control, SWT.NONE ); // padding
+        new Label(control, SWT.NONE).setText("Installs:");
+        new Label(control, SWT.NONE); // padding
 
-        Table table = new Table( control, SWT.CHECK | SWT.SINGLE | SWT.BORDER );
+        Table table = new Table(control, SWT.CHECK | SWT.SINGLE | SWT.BORDER);
 
-        Button add = new Button( control, SWT.PUSH );
-        add.setText( "Add" );
-        add.addSelectionListener( new SelectionAdapter()
+        Button add = new Button(control, SWT.PUSH);
+        add.setText("Add");
+        add.addSelectionListener(new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
                 add();
             }
-        } );
+        });
 
-        final Button remove = new Button( control, SWT.PUSH );
-        remove.setEnabled( false );
-        remove.setText( "Remove" );
-        remove.addSelectionListener( new SelectionAdapter()
+        final Button remove = new Button(control, SWT.PUSH);
+        remove.setEnabled(false);
+        remove.setText("Remove");
+        remove.addSelectionListener(new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
                 remove();
             }
-        } );
+        });
 
         // viewers
-        viewer = new CheckboxTableViewer( table );
-        viewer.setContentProvider( new DefaultTableProvider()
+        viewer = new CheckboxTableViewer(table);
+        viewer.setContentProvider(new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                return toArray( inputElement );
+                return toArray(inputElement);
             }
-        } );
+        });
 
-        viewer.setLabelProvider( new LabelProvider()
+        viewer.setLabelProvider(new LabelProvider()
         {
             @Override
-            public String getText( Object element )
+            public String getText(Object element)
             {
-                Install i = ( Install ) element;
+                Install i = (Install) element;
                 IOSGiInstallType type = i.getType();
-                if ( type == null )
+                if (type == null)
                 {
                     return "<invalid> [" + i.location + "]";
                 }
                 else
                 {
-                    return type.getName() + " " + type.getVersion() + " [" + i.location + "]";
+                    return type.getName() + " " + type.getVersion() + " [" + i.location
+                        + "]";
                 }
             }
 
-
             @Override
-            public Image getImage( Object element )
+            public Image getImage(Object element)
             {
-                Install i = ( Install ) element;
+                Install i = (Install) element;
                 IOSGiInstallType type = i.getType();
 
-                if ( type == null )
+                if (type == null)
                 {
                     return null;
                 }
@@ -192,139 +183,134 @@ public class OSGiInstallsPreferencePage 
                     return type.getIcon();
                 }
             }
-        } );
+        });
 
-        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        viewer.addSelectionChangedListener(new ISelectionChangedListener()
         {
-            public void selectionChanged( SelectionChangedEvent event )
+            public void selectionChanged(SelectionChangedEvent event)
             {
                 boolean enabled = !event.getSelection().isEmpty();
-                remove.setEnabled( enabled );
+                remove.setEnabled(enabled);
             }
-        } );
+        });
 
-        viewer.addCheckStateListener( new ICheckStateListener()
+        viewer.addCheckStateListener(new ICheckStateListener()
         {
-            public void checkStateChanged( CheckStateChangedEvent event )
+            public void checkStateChanged(CheckStateChangedEvent event)
             {
-                if ( event.getChecked() )
+                if (event.getChecked())
                 {
                     changed = true;
                 }
-                viewer.setCheckedElements( new Object[]
-                    { event.getElement() } );
+                viewer.setCheckedElements(new Object[] { event.getElement() });
             }
-        } );
+        });
 
-        viewer.setInput( installs.values() );
+        viewer.setInput(installs.values());
 
         // layout
-        control.setLayout( new GridLayout( 2, false ) );
-        table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 1, 3 ) );
-        add.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false ) );
-        remove.setLayoutData( new GridData( SWT.FILL, SWT.FILL, false, false ) );
+        control.setLayout(new GridLayout(2, false));
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3));
+        add.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        remove.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
     }
 
-
     private void load()
     {
-        String pref = getPreferenceStore().getString( SigilCore.OSGI_INSTALLS );
-        if ( pref != null && pref.length() > 0 )
+        String pref = getPreferenceStore().getString(SigilCore.OSGI_INSTALLS);
+        if (pref != null && pref.length() > 0)
         {
-            for ( String id : pref.split( "," ) )
+            for (String id : pref.split(","))
             {
-                String loc = getPreferenceStore().getString( SigilCore.OSGI_INSTALL_PREFIX + id );
-                installs.put( id, new Install( id, loc ) );
+                String loc = getPreferenceStore().getString(
+                    SigilCore.OSGI_INSTALL_PREFIX + id);
+                installs.put(id, new Install(id, loc));
             }
         }
 
         viewer.refresh();
 
-        if ( !installs.isEmpty() )
+        if (!installs.isEmpty())
         {
-            String defId = getPreferenceStore().getString( SigilCore.OSGI_DEFAULT_INSTALL_ID );
-            if ( defId == null || defId.trim().length() == 0 )
+            String defId = getPreferenceStore().getString(
+                SigilCore.OSGI_DEFAULT_INSTALL_ID);
+            if (defId == null || defId.trim().length() == 0)
             {
-                viewer.setCheckedElements( new Object[]
-                    { installs.values().iterator().next() } );
+                viewer.setCheckedElements(new Object[] { installs.values().iterator().next() });
             }
             else
             {
-                viewer.setCheckedElements( new Object[]
-                    { installs.get( defId ) } );
+                viewer.setCheckedElements(new Object[] { installs.get(defId) });
             }
         }
     }
 
-
     protected void doSave()
     {
         // zero out old configs
-        String pref = getPreferenceStore().getString( SigilCore.OSGI_INSTALLS );
-        if ( pref != null && pref.length() > 0 )
+        String pref = getPreferenceStore().getString(SigilCore.OSGI_INSTALLS);
+        if (pref != null && pref.length() > 0)
         {
-            for ( String id : pref.split( "," ) )
+            for (String id : pref.split(","))
             {
-                getPreferenceStore().setToDefault( SigilCore.OSGI_INSTALL_PREFIX + id );
+                getPreferenceStore().setToDefault(SigilCore.OSGI_INSTALL_PREFIX + id);
             }
         }
 
         // store new configs
-        if ( installs.isEmpty() )
+        if (installs.isEmpty())
         {
-            getPreferenceStore().setToDefault( SigilCore.OSGI_INSTALLS );
-            getPreferenceStore().setToDefault( SigilCore.OSGI_DEFAULT_INSTALL_ID );
+            getPreferenceStore().setToDefault(SigilCore.OSGI_INSTALLS);
+            getPreferenceStore().setToDefault(SigilCore.OSGI_DEFAULT_INSTALL_ID);
         }
         else
         {
             StringBuffer buf = new StringBuffer();
-            for ( Install i : installs.values() )
+            for (Install i : installs.values())
             {
-                if ( buf.length() > 0 )
+                if (buf.length() > 0)
                 {
-                    buf.append( "," );
+                    buf.append(",");
                 }
-                buf.append( i.id );
-                getPreferenceStore().setValue( SigilCore.OSGI_INSTALL_PREFIX + i.id, i.location );
+                buf.append(i.id);
+                getPreferenceStore().setValue(SigilCore.OSGI_INSTALL_PREFIX + i.id,
+                    i.location);
             }
 
-            getPreferenceStore().setValue( SigilCore.OSGI_INSTALLS, buf.toString() );
-            Install def = ( Install ) viewer.getCheckedElements()[0];
-            getPreferenceStore().setValue( SigilCore.OSGI_DEFAULT_INSTALL_ID, def.id );
+            getPreferenceStore().setValue(SigilCore.OSGI_INSTALLS, buf.toString());
+            Install def = (Install) viewer.getCheckedElements()[0];
+            getPreferenceStore().setValue(SigilCore.OSGI_DEFAULT_INSTALL_ID, def.id);
         }
         changed = false;
     }
 
-
     private boolean isOK()
     {
         return installs.isEmpty() || viewer.getCheckedElements().length > 0;
     }
 
-
     private void add()
     {
         Shell shell = SigilUI.getActiveWorkbenchShell();
-        DirectoryDialog dialog = new DirectoryDialog( shell );
+        DirectoryDialog dialog = new DirectoryDialog(shell);
         String dir = dialog.open();
-        if ( dir != null )
+        if (dir != null)
         {
-            Install install = new Install( UUID.randomUUID().toString(), dir );
-            if ( install.getType() == null )
+            Install install = new Install(UUID.randomUUID().toString(), dir);
+            if (install.getType() == null)
             {
-                MessageDialog.openError( shell, "Error", "Invalid OSGi install directory" );
+                MessageDialog.openError(shell, "Error", "Invalid OSGi install directory");
             }
             else
             {
                 boolean empty = installs.isEmpty();
 
-                installs.put( install.id, install );
+                installs.put(install.id, install);
                 viewer.refresh();
 
-                if ( empty )
+                if (empty)
                 {
-                    viewer.setCheckedElements( new Object[]
-                        { install } );
+                    viewer.setCheckedElements(new Object[] { install });
                 }
 
                 checkValid();
@@ -333,39 +319,35 @@ public class OSGiInstallsPreferencePage 
         }
     }
 
-
     private void checkValid()
     {
-        if ( isOK() )
+        if (isOK())
         {
-            setErrorMessage( null );
-            setValid( true );
+            setErrorMessage(null);
+            setValid(true);
         }
         else
         {
-            setErrorMessage( "Missing default OSGi install" );
-            setValid( false );
+            setErrorMessage("Missing default OSGi install");
+            setValid(false);
         }
     }
 
-
     private void remove()
     {
-        IStructuredSelection sel = ( IStructuredSelection ) viewer.getSelection();
-        Install i = ( Install ) sel.getFirstElement();
-        boolean def = viewer.getChecked( i );
-        installs.remove( i.id );
+        IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
+        Install i = (Install) sel.getFirstElement();
+        boolean def = viewer.getChecked(i);
+        installs.remove(i.id);
         viewer.refresh();
-        if ( def && installs.size() > 0 )
+        if (def && installs.size() > 0)
         {
-            viewer.setCheckedElements( new Object[]
-                { installs.values().iterator().next() } );
+            viewer.setCheckedElements(new Object[] { installs.values().iterator().next() });
         }
         checkValid();
         changed = true;
     }
 
-
     @Override
     protected IPreferenceStore doGetPreferenceStore()
     {

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/project/ProjectPropertyPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/project/ProjectPropertyPage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/project/ProjectPropertyPage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/project/ProjectPropertyPage.java Mon Aug  2 17:08:03 2010
@@ -19,7 +19,6 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.project;
 
-
 import java.util.concurrent.Callable;
 
 import org.apache.felix.sigil.eclipse.SigilCore;
@@ -49,7 +48,6 @@ import org.eclipse.ui.dialogs.Preference
 import org.eclipse.ui.dialogs.PropertyPage;
 import org.osgi.service.prefs.BackingStoreException;
 
-
 public class ProjectPropertyPage extends PropertyPage implements IWorkbenchPropertyPage
 {
 
@@ -58,170 +56,163 @@ public class ProjectPropertyPage extends
     private Composite settings;
     private Button projectSpecificBtn;
 
-
     @Override
-    protected Control createContents( Composite parent )
+    protected Control createContents(Composite parent)
     {
-        final Composite control = new Composite( parent, SWT.NONE );
+        final Composite control = new Composite(parent, SWT.NONE);
 
-        projectSpecificBtn = new Button( control, SWT.CHECK );
-        projectSpecificBtn.setText( "Enable project specific settings" );
-        projectSpecificBtn.addSelectionListener( new SelectionAdapter()
+        projectSpecificBtn = new Button(control, SWT.CHECK);
+        projectSpecificBtn.setText("Enable project specific settings");
+        projectSpecificBtn.addSelectionListener(new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
-                setProjectSpecific( !projectSpecific );
+                setProjectSpecific(!projectSpecific);
             }
-        } );
+        });
 
-        Label link = new Label( control, SWT.UNDERLINE_SINGLE );
-        link.addMouseListener( new MouseAdapter()
+        Label link = new Label(control, SWT.UNDERLINE_SINGLE);
+        link.addMouseListener(new MouseAdapter()
         {
             @Override
-            public void mouseDown( MouseEvent e )
+            public void mouseDown(MouseEvent e)
             {
-                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn( null,
-                    SigilCore.REPOSITORIES_PREFERENCES_ID, null, null );
+                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null,
+                    SigilCore.REPOSITORIES_PREFERENCES_ID, null, null);
                 dialog.open();
             }
-        } );
+        });
 
-        link.setText( "Configure workspace settings" );
+        link.setText("Configure workspace settings");
 
-        settings = new Composite( control, SWT.BORDER );
-        settings.setLayout( new GridLayout( 1, false ) );
-        createSettings( settings );
+        settings = new Composite(control, SWT.BORDER);
+        settings.setLayout(new GridLayout(1, false));
+        createSettings(settings);
 
-        setFonts( control );
+        setFonts(control);
 
         // layout
-        control.setLayout( new GridLayout( 2, false ) );
-        projectSpecificBtn.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
-        settings.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 2, 1 ) );
+        control.setLayout(new GridLayout(2, false));
+        projectSpecificBtn.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        settings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
 
         // load settings
         String currentSet = getCurrentSet();
 
-        if ( currentSet == null )
+        if (currentSet == null)
         {
-            setProjectSpecific( false );
+            setProjectSpecific(false);
         }
         else
         {
-            setView.setSelection( new StructuredSelection( currentSet ) );
-            setProjectSpecific( true );
+            setView.setSelection(new StructuredSelection(currentSet));
+            setProjectSpecific(true);
         }
 
         return control;
     }
 
-
-    private void setFonts( Composite control )
+    private void setFonts(Composite control)
     {
         Composite p = control.getParent();
-        for ( Control c : control.getChildren() )
+        for (Control c : control.getChildren())
         {
-            c.setFont( p.getFont() );
-            if ( c instanceof Composite )
+            c.setFont(p.getFont());
+            if (c instanceof Composite)
             {
-                setFonts( ( Composite ) c );
+                setFonts((Composite) c);
             }
         }
     }
 
-
-    private void setProjectSpecific( boolean projectSpecific )
+    private void setProjectSpecific(boolean projectSpecific)
     {
-        if ( this.projectSpecific != projectSpecific )
+        if (this.projectSpecific != projectSpecific)
         {
             this.projectSpecific = projectSpecific;
-            settings.setEnabled( projectSpecific );
-            for ( Control c : settings.getChildren() )
+            settings.setEnabled(projectSpecific);
+            for (Control c : settings.getChildren())
             {
-                c.setEnabled( projectSpecific );
+                c.setEnabled(projectSpecific);
             }
-            projectSpecificBtn.setSelection( projectSpecific );
+            projectSpecificBtn.setSelection(projectSpecific);
         }
     }
 
-
-    private void createSettings( Composite parent )
+    private void createSettings(Composite parent)
     {
-        Composite control = new Composite( parent, SWT.NONE );
+        Composite control = new Composite(parent, SWT.NONE);
 
-        new Label( control, SWT.NONE ).setText( "Repository Set:" );
-        Combo combo = new Combo( control, SWT.SINGLE );
+        new Label(control, SWT.NONE).setText("Repository Set:");
+        Combo combo = new Combo(control, SWT.SINGLE);
 
-        setView = new ComboViewer( combo );
-        setView.setContentProvider( new DefaultTableProvider()
+        setView = new ComboViewer(combo);
+        setView.setContentProvider(new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                return toArray( inputElement );
+                return toArray(inputElement);
             }
-        } );
+        });
 
-        setView.setInput( SigilCore.getRepositoryConfiguration().loadRepositorySets().keySet() );
+        setView.setInput(SigilCore.getRepositoryConfiguration().loadRepositorySets().keySet());
 
         // layout
-        control.setLayout( new GridLayout( 2, false ) );
+        control.setLayout(new GridLayout(2, false));
     }
 
-
     private String getCurrentSet()
     {
         try
         {
-            IProject p = ( IProject ) getElement().getAdapter( IProject.class );
-            ISigilProjectModel model = SigilCore.create( p );
-            return model.getPreferences().get( SigilCore.REPOSITORY_SET, null );
+            IProject p = (IProject) getElement().getAdapter(IProject.class);
+            ISigilProjectModel model = SigilCore.create(p);
+            return model.getPreferences().get(SigilCore.REPOSITORY_SET, null);
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to read repository set", e );
+            SigilCore.error("Failed to read repository set", e);
             return null;
         }
     }
 
-
     @Override
     public boolean okToLeave()
     {
-        if ( projectSpecific )
+        if (projectSpecific)
         {
-            if ( setView.getSelection().isEmpty() )
+            if (setView.getSelection().isEmpty())
             {
-                setErrorMessage( "Must select a repository set" );
+                setErrorMessage("Must select a repository set");
                 return false;
             }
         }
-        setErrorMessage( null );
+        setErrorMessage(null);
         return true;
     }
 
-
     @Override
     public boolean performOk()
     {
-        return ProjectUtils.runTaskWithRebuildCheck( new Callable<Boolean>()
+        return ProjectUtils.runTaskWithRebuildCheck(new Callable<Boolean>()
         {
             public Boolean call() throws CoreException, BackingStoreException
             {
                 String set = null;
-                if ( projectSpecific )
+                if (projectSpecific)
                 {
-                    set = ( String ) ( ( IStructuredSelection ) setView.getSelection() ).getFirstElement();
+                    set = (String) ((IStructuredSelection) setView.getSelection()).getFirstElement();
                 }
 
-                IProject p = ( IProject ) getElement().getAdapter( IProject.class );
-                ISigilProjectModel model = SigilCore.create( p );
-                model.getPreferences().put( SigilCore.REPOSITORY_SET, set );
+                IProject p = (IProject) getElement().getAdapter(IProject.class);
+                ISigilProjectModel model = SigilCore.create(p);
+                model.getPreferences().put(SigilCore.REPOSITORY_SET, set);
                 model.getPreferences().flush();
                 return true;
             }
 
-        }, getShell() );
+        }, getShell());
     }
 
 }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/NewRepositoryWizard.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/NewRepositoryWizard.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/NewRepositoryWizard.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/NewRepositoryWizard.java Mon Aug  2 17:08:03 2010
@@ -19,11 +19,9 @@
 
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
-
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
 import org.eclipse.jface.wizard.Wizard;
 
-
 public class NewRepositoryWizard extends Wizard
 {
 
@@ -31,13 +29,11 @@ public class NewRepositoryWizard extends
 
     private RepositoryTypeSelectionPage page = new RepositoryTypeSelectionPage();
 
-
     public void addPages()
     {
-        addPage( page );
+        addPage(page);
     }
 
-
     @Override
     public boolean performFinish()
     {
@@ -45,14 +41,12 @@ public class NewRepositoryWizard extends
         return true;
     }
 
-
     @Override
     public boolean needsPreviousAndNextButtons()
     {
         return true;
     }
 
-
     public IRepositoryModel getRepository()
     {
         return repository;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.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.IRepositoryConfiguration;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositorySet;
@@ -37,7 +36,6 @@ import org.eclipse.swt.widgets.TabItem;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
-
 public class RepositoriesPreferencePage extends ProjectDependentPreferencesPage implements IWorkbenchPreferencePage
 {
 
@@ -45,89 +43,82 @@ public class RepositoriesPreferencePage 
     private RepositoriesView viewPage;
     private RepositorySetsView setPage;
 
-
     public RepositoriesPreferencePage()
     {
-        super( "Repository Preferences" );
+        super("Repository Preferences");
     }
 
-
     @Override
-    protected Control createContents( Composite parent )
+    protected Control createContents(Composite parent)
     {
-        Control control = initContents( parent );
+        Control control = initContents(parent);
         return control;
     }
 
-
     @Override
     protected IPreferenceStore doGetPreferenceStore()
     {
         return SigilCore.getDefault().getPreferenceStore();
     }
 
-
     protected void changed()
     {
         changed = true;
         updateApplyButton();
     }
 
-
-    private Control initContents( Composite parent )
+    private Control initContents(Composite parent)
     {
-        viewPage = new RepositoriesView( this );
-        setPage = new RepositorySetsView( this );
+        viewPage = new RepositoriesView(this);
+        setPage = new RepositorySetsView(this);
 
-        Composite control = new Composite( parent, SWT.NONE );
+        Composite control = new Composite(parent, SWT.NONE);
 
-        TabFolder folder = new TabFolder( control, SWT.TOP );
+        TabFolder folder = new TabFolder(control, SWT.TOP);
 
-        TabItem view = new TabItem( folder, SWT.NONE );
-        view.setText( "Repositories" );
-        view.setControl( viewPage.createContents( folder ) );
+        TabItem view = new TabItem(folder, SWT.NONE);
+        view.setText("Repositories");
+        view.setControl(viewPage.createContents(folder));
 
-        TabItem sets = new TabItem( folder, SWT.NONE );
-        sets.setText( "Sets" );
-        sets.setControl( setPage.createContents( folder ) );
+        TabItem sets = new TabItem(folder, SWT.NONE);
+        sets.setText("Sets");
+        sets.setControl(setPage.createContents(folder));
 
-        control.setLayout( new GridLayout( 1, true ) );
-        folder.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
+        control.setLayout(new GridLayout(1, true));
+        folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
         return control;
     }
 
-
-    public void init( IWorkbench workbench )
+    public void init(IWorkbench workbench)
     {
         // TODO Auto-generated method stub
 
     }
 
-
     @Override
     protected void doSave()
     {
         try
         {
             IRepositoryConfiguration config = SigilCore.getRepositoryConfiguration();
-            config.saveRepositories( viewPage.getRepositories() );
-            config.saveRepositorySets( setPage.getSets() );
-            IRepositorySet defaultSet = new RepositorySet( setPage.getDefaultRepositories() );
-            config.setDefaultRepositorySet( defaultSet );
+            config.saveRepositories(viewPage.getRepositories());
+            config.saveRepositorySets(setPage.getSets());
+            IRepositorySet defaultSet = new RepositorySet(
+                setPage.getDefaultRepositories());
+            config.setDefaultRepositorySet(defaultSet);
 
-            setErrorMessage( null );
-            getApplyButton().setEnabled( false );
+            setErrorMessage(null);
+            getApplyButton().setEnabled(false);
             changed = false;
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            setErrorMessage( "Failed to save repositories:" + e.getStatus().getMessage() );
-            SigilCore.error( "Failed to save repositories", e );
+            setErrorMessage("Failed to save repositories:" + e.getStatus().getMessage());
+            SigilCore.error("Failed to save repositories", e);
         }
     }
 
-
     @Override
     protected boolean isDirty()
     {

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.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;
 import java.util.List;
@@ -50,7 +49,6 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Table;
 
-
 public class RepositoriesView
 {
     private final RepositoriesPreferencePage page;
@@ -59,260 +57,247 @@ public class RepositoriesView
 
     private TableViewer repositoryView;
 
-
-    public RepositoriesView( RepositoriesPreferencePage page )
+    public RepositoriesView(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.MULTI | SWT.BORDER );
+        Table table = new Table(composite, SWT.MULTI | SWT.BORDER);
 
         // Table Viewer Setup
-        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)
             {
-                IRepositoryModel rep = ( IRepositoryModel ) element;
+                IRepositoryModel rep = (IRepositoryModel) element;
                 return rep.getName();
             }
 
-
             @Override
-            public Image getImage( Object element )
+            public Image getImage(Object element)
             {
-                IRepositoryModel rep = ( IRepositoryModel ) element;
+                IRepositoryModel rep = (IRepositoryModel) element;
                 return rep.getType().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);
             }
-        } );
+        });
 
         // 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, repositoryView );
+        createButtons(composite, repositoryView);
 
         repositories = SigilCore.getRepositoryConfiguration().loadRepositories();
-        repositoryView.setInput( repositories );
+        repositoryView.setInput(repositories);
 
         return composite;
     }
 
-
-    private void createButtons( final Composite composite, final TableViewer repositoryView )
+    private void createButtons(final Composite composite, final TableViewer repositoryView)
     {
-        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 refresh = new Button( composite, SWT.PUSH );
-        refresh.setText( "Refresh" );
-        refresh.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);
+
+        final Button refresh = new Button(composite, SWT.PUSH);
+        refresh.setText("Refresh");
+        refresh.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 ) repositoryView.getSelection();
-                edit( composite, sel );
+                IStructuredSelection sel = (IStructuredSelection) repositoryView.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 ) repositoryView.getSelection();
-                remove( sel );
+                IStructuredSelection sel = (IStructuredSelection) repositoryView.getSelection();
+                remove(sel);
             }
-        } );
+        });
 
-        refresh.addSelectionListener( new SelectionAdapter()
+        refresh.addSelectionListener(new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
-                IStructuredSelection sel = ( IStructuredSelection ) repositoryView.getSelection();
-                refresh( composite, sel );
+                IStructuredSelection sel = (IStructuredSelection) repositoryView.getSelection();
+                refresh(composite, sel);
             }
-        } );
+        });
 
-        repositoryView.addSelectionChangedListener( new ISelectionChangedListener()
+        repositoryView.addSelectionChangedListener(new ISelectionChangedListener()
         {
-            public void selectionChanged( SelectionChangedEvent event )
+            public void selectionChanged(SelectionChangedEvent event)
             {
                 boolean selected = !event.getSelection().isEmpty();
-                if ( selected )
+                if (selected)
                 {
-                    refresh.setEnabled( true );
+                    refresh.setEnabled(true);
 
-                    IStructuredSelection sel = ( IStructuredSelection ) event.getSelection();
+                    IStructuredSelection sel = (IStructuredSelection) event.getSelection();
 
-                    checkEditEnabled( edit, sel );
-                    checkRemoveEnabled( remove, sel );
+                    checkEditEnabled(edit, sel);
+                    checkRemoveEnabled(remove, sel);
                 }
                 else
                 {
-                    refresh.setEnabled( false );
-                    edit.setEnabled( false );
-                    remove.setEnabled( false );
+                    refresh.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));
     }
 
-
     @SuppressWarnings("unchecked")
-    private void checkRemoveEnabled( Button button, IStructuredSelection sel )
+    private void checkRemoveEnabled(Button button, IStructuredSelection sel)
     {
         boolean alldynamic = true;
-        for ( Iterator i = sel.iterator(); i.hasNext(); )
+        for (Iterator i = sel.iterator(); i.hasNext();)
         {
-            IRepositoryModel model = ( IRepositoryModel ) i.next();
-            if ( !model.getType().isDynamic() )
+            IRepositoryModel model = (IRepositoryModel) i.next();
+            if (!model.getType().isDynamic())
             {
                 alldynamic = false;
                 break;
             }
         }
-        button.setEnabled( alldynamic );
+        button.setEnabled(alldynamic);
     }
 
-
-    private void checkEditEnabled( Button edit, IStructuredSelection sel )
+    private void checkEditEnabled(Button edit, IStructuredSelection sel)
     {
-        if ( sel.size() == 1 )
+        if (sel.size() == 1)
         {
-            IRepositoryModel element = ( IRepositoryModel ) sel.getFirstElement();
-            if ( WizardHelper.hasWizard( element.getType() ) )
+            IRepositoryModel element = (IRepositoryModel) sel.getFirstElement();
+            if (WizardHelper.hasWizard(element.getType()))
             {
-                edit.setEnabled( true );
+                edit.setEnabled(true);
             }
             else
             {
-                edit.setEnabled( false );
+                edit.setEnabled(false);
             }
         }
         else
         {
-            edit.setEnabled( false );
+            edit.setEnabled(false);
         }
     }
 
-
     @SuppressWarnings("unchecked")
-    protected void refresh( Control parent, IStructuredSelection sel )
+    protected void refresh(Control parent, IStructuredSelection sel)
     {
-        ArrayList<IRepositoryModel> models = new ArrayList<IRepositoryModel>( sel.size() );
+        ArrayList<IRepositoryModel> models = new ArrayList<IRepositoryModel>(sel.size());
 
-        for ( Iterator i = sel.iterator(); i.hasNext(); )
+        for (Iterator i = sel.iterator(); i.hasNext();)
         {
-            IRepositoryModel model = ( IRepositoryModel ) i.next();
-            models.add( model );
+            IRepositoryModel model = (IRepositoryModel) i.next();
+            models.add(model);
         }
 
-        new RefreshRepositoryAction( models.toArray( new IRepositoryModel[models.size()] ) ).run();
+        new RefreshRepositoryAction(models.toArray(new IRepositoryModel[models.size()])).run();
     }
 
-
-    private void add( Control parent )
+    private void add(Control parent)
     {
         NewRepositoryWizard wizard = new NewRepositoryWizard();
-        WizardDialog dialog = new WizardDialog( getShell( parent ), wizard );
-        if ( dialog.open() == Window.OK )
+        WizardDialog dialog = new WizardDialog(getShell(parent), wizard);
+        if (dialog.open() == Window.OK)
         {
-            repositories.add( wizard.getRepository() );
+            repositories.add(wizard.getRepository());
             updated();
         }
     }
 
-
-    private void edit( Control parent, IStructuredSelection sel )
+    private void edit(Control parent, IStructuredSelection sel)
     {
-        IRepositoryModel model = ( IRepositoryModel ) sel.getFirstElement();
+        IRepositoryModel model = (IRepositoryModel) sel.getFirstElement();
         try
         {
-            RepositoryWizard wizard = WizardHelper.loadWizard( model.getType() );
-            wizard.init( model );
-            WizardDialog dialog = new WizardDialog( getShell( parent ), wizard );
-            if ( dialog.open() == Window.OK )
+            RepositoryWizard wizard = WizardHelper.loadWizard(model.getType());
+            wizard.init(model);
+            WizardDialog dialog = new WizardDialog(getShell(parent), wizard);
+            if (dialog.open() == Window.OK)
             {
                 updated();
             }
         }
-        catch ( CoreException e )
+        catch (CoreException e)
         {
-            SigilCore.error( "Failed to load wizard", e );
-            MessageDialog
-                .openError( getShell( parent ), "Error", "Failed to load wizard:" + e.getStatus().getMessage() );
+            SigilCore.error("Failed to load wizard", e);
+            MessageDialog.openError(getShell(parent), "Error", "Failed to load wizard:"
+                + e.getStatus().getMessage());
         }
     }
 
-
-    private Shell getShell( Control parent )
+    private Shell getShell(Control parent)
     {
         return parent.getShell();
     }
 
-
     @SuppressWarnings("unchecked")
-    private void remove( IStructuredSelection sel )
+    private void remove(IStructuredSelection sel)
     {
         boolean change = false;
-        for ( Iterator i = sel.iterator(); i.hasNext(); )
+        for (Iterator i = sel.iterator(); i.hasNext();)
         {
-            change = repositories.remove( i.next() );
+            change = repositories.remove(i.next());
         }
 
-        if ( change )
+        if (change)
         {
             updated();
         }
     }
 
-
     private void updated()
     {
         repositoryView.refresh();
         page.changed();
     }
 
-
     public List<IRepositoryModel> getRepositories()
     {
         return repositories;

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetDialog.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetDialog.java?rev=981604&r1=981603&r2=981604&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetDialog.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetDialog.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.Arrays;
 import java.util.List;
@@ -50,7 +49,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
-
 public class RepositorySetDialog extends TitleAreaDialog
 {
 
@@ -65,101 +63,94 @@ public class RepositorySetDialog extends
 
     private String newName;
 
-
-    public RepositorySetDialog( Shell shell, Set<String> set )
+    public RepositorySetDialog(Shell shell, Set<String> set)
     {
-        this( shell, null, true, set );
+        this(shell, null, true, set);
     }
 
-
-    public RepositorySetDialog( Shell parent, RepositoryViewData data, boolean nameEditable, Set<String> set )
+    public RepositorySetDialog(Shell parent, RepositoryViewData data, boolean nameEditable, Set<String> set)
     {
-        super( parent );
+        super(parent);
         this.set = set;
         this.setName = data == null ? "" : data.getName();
-        this.repositories = data == null ? new ArrayList<IRepositoryModel>() : new ArrayList<IRepositoryModel>( Arrays
-            .asList( data.getRepositories() ) );
+        this.repositories = data == null ? new ArrayList<IRepositoryModel>()
+            : new ArrayList<IRepositoryModel>(Arrays.asList(data.getRepositories()));
         this.nameEditable = nameEditable;
     }
 
-
     @Override
-    protected Control createDialogArea( Composite parent )
+    protected Control createDialogArea(Composite parent)
     {
-        Composite area = ( Composite ) super.createDialogArea( parent );
-        createControl( area );
+        Composite area = (Composite) super.createDialogArea(parent);
+        createControl(area);
         return area;
     }
 
-
-    public void createControl( Composite parent )
+    public void createControl(Composite parent)
     {
         // controls
-        Composite body = new Composite( parent, SWT.NONE );
-        body.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+        Composite body = new Composite(parent, SWT.NONE);
+        body.setLayoutData(new GridData(GridData.FILL_BOTH));
 
-        if ( nameEditable )
+        if (nameEditable)
         {
-            new Label( body, SWT.NONE ).setText( "Name" );
+            new Label(body, SWT.NONE).setText("Name");
 
-            nameTxt = new Text( body, SWT.BORDER );
+            nameTxt = new Text(body, SWT.BORDER);
 
-            nameTxt.setText( setName );
+            nameTxt.setText(setName);
 
-            nameTxt.addKeyListener( new KeyAdapter()
+            nameTxt.addKeyListener(new KeyAdapter()
             {
                 @Override
-                public void keyReleased( KeyEvent e )
+                public void keyReleased(KeyEvent e)
                 {
                     checkComplete();
                 }
-            } );
+            });
         }
 
-        Composite table = new Composite( body, SWT.NONE );
-        table.setLayout( new GridLayout( 2, false ) );
-        createTable( table );
+        Composite table = new Composite(body, SWT.NONE);
+        table.setLayout(new GridLayout(2, false));
+        createTable(table);
 
         // layout
-        body.setLayout( new GridLayout( 2, false ) );
-        if ( nameEditable )
+        body.setLayout(new GridLayout(2, false));
+        if (nameEditable)
         {
-            nameTxt.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
+            nameTxt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
         }
-        table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 2, 1 ) );
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
     }
 
-
     public RepositoryViewData getData()
     {
         String name = nameEditable ? newName : setName;
-        IRepositoryModel[] reps = repositories.toArray( new IRepositoryModel[repositories.size()] );
-        return new RepositoryViewData( name, reps );
+        IRepositoryModel[] reps = repositories.toArray(new IRepositoryModel[repositories.size()]);
+        return new RepositoryViewData(name, reps);
     }
 
-
     private void checkComplete()
     {
-        if ( nameEditable )
+        if (nameEditable)
         {
             String name = nameTxt.getText();
-            if ( !name.equals( setName ) && set.contains( name ) )
+            if (!name.equals(setName) && set.contains(name))
             {
-                setErrorMessage( "Set " + name + " already exists" );
-                Button b = getButton( IDialogConstants.OK_ID );
-                b.setEnabled( false );
+                setErrorMessage("Set " + name + " already exists");
+                Button b = getButton(IDialogConstants.OK_ID);
+                b.setEnabled(false);
             }
         }
-        setErrorMessage( null );
-        Button b = getButton( IDialogConstants.OK_ID );
-        b.setEnabled( true );
+        setErrorMessage(null);
+        Button b = getButton(IDialogConstants.OK_ID);
+        b.setEnabled(true);
     }
 
-
     @Override
     protected void okPressed()
     {
-        if ( nameEditable )
+        if (nameEditable)
         {
             newName = nameTxt.getText();
         }
@@ -167,150 +158,140 @@ public class RepositorySetDialog extends
         super.okPressed();
     }
 
-
-    private void createTable( Composite body )
+    private void createTable(Composite body)
     {
-        createViewer( body );
+        createViewer(body);
 
-        Composite btns = new Composite( body, SWT.NONE );
-        btns.setLayout( new GridLayout( 1, true ) );
+        Composite btns = new Composite(body, SWT.NONE);
+        btns.setLayout(new GridLayout(1, true));
 
-        createButtons( btns );
+        createButtons(btns);
 
         // layout
-        viewer.getTable().setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
-        btns.setLayoutData( new GridData( SWT.RIGHT, SWT.TOP, false, false ) );
+        viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        btns.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
     }
 
-
-    private void createButtons( Composite parent )
+    private void createButtons(Composite parent)
     {
-        upBtn = new Button( parent, SWT.PUSH );
-        upBtn.setText( "Up" );
-        upBtn.addSelectionListener( new SelectionAdapter()
+        upBtn = new Button(parent, SWT.PUSH);
+        upBtn.setText("Up");
+        upBtn.addSelectionListener(new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
                 up();
             }
-        } );
+        });
 
-        downBtn = new Button( parent, SWT.PUSH );
-        downBtn.setText( "Down" );
-        downBtn.addSelectionListener( new SelectionAdapter()
+        downBtn = new Button(parent, SWT.PUSH);
+        downBtn.setText("Down");
+        downBtn.addSelectionListener(new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected(SelectionEvent e)
             {
                 down();
             }
-        } );
+        });
 
-        setUpDownEnabled( false );
+        setUpDownEnabled(false);
     }
 
-
     private void up()
     {
-        IRepositoryModel model = ( IRepositoryModel ) ( ( StructuredSelection ) viewer.getSelection() )
-            .getFirstElement();
-        int i = repositories.indexOf( model );
-        if ( i > 0 )
+        IRepositoryModel model = (IRepositoryModel) ((StructuredSelection) viewer.getSelection()).getFirstElement();
+        int i = repositories.indexOf(model);
+        if (i > 0)
         {
-            repositories.remove( i );
-            repositories.add( i - 1, model );
+            repositories.remove(i);
+            repositories.add(i - 1, model);
             viewer.refresh();
         }
     }
 
-
     private void down()
     {
-        IRepositoryModel model = ( IRepositoryModel ) ( ( StructuredSelection ) viewer.getSelection() )
-            .getFirstElement();
-        int i = repositories.indexOf( model );
-        if ( i < repositories.size() - 1 )
+        IRepositoryModel model = (IRepositoryModel) ((StructuredSelection) viewer.getSelection()).getFirstElement();
+        int i = repositories.indexOf(model);
+        if (i < repositories.size() - 1)
         {
-            repositories.remove( i );
-            repositories.add( i + 1, model );
+            repositories.remove(i);
+            repositories.add(i + 1, model);
             viewer.refresh();
         }
     }
 
-
-    private void createViewer( Composite parent )
+    private void createViewer(Composite parent)
     {
-        viewer = CheckboxTableViewer.newCheckList( parent, SWT.BORDER );
+        viewer = CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
 
-        viewer.addSelectionChangedListener( new ISelectionChangedListener()
+        viewer.addSelectionChangedListener(new ISelectionChangedListener()
         {
-            public void selectionChanged( SelectionChangedEvent event )
+            public void selectionChanged(SelectionChangedEvent event)
             {
-                setUpDownEnabled( !viewer.getSelection().isEmpty() );
+                setUpDownEnabled(!viewer.getSelection().isEmpty());
             }
-        } );
+        });
 
-        viewer.setContentProvider( new DefaultTableProvider()
+        viewer.setContentProvider(new DefaultTableProvider()
         {
-            public Object[] getElements( Object inputElement )
+            public Object[] getElements(Object inputElement)
             {
-                return toArray( inputElement );
+                return toArray(inputElement);
             }
-        } );
+        });
 
-        viewer.setLabelProvider( new DefaultLabelProvider()
+        viewer.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)
             {
-                IRepositoryModel m = ( IRepositoryModel ) element;
+                IRepositoryModel m = (IRepositoryModel) element;
                 return m.getName();
             }
-        } );
+        });
 
-        viewer.setInput( repositories );
+        viewer.setInput(repositories);
 
-        for ( IRepositoryModel m : repositories )
+        for (IRepositoryModel m : repositories)
         {
-            viewer.setChecked( m, true );
+            viewer.setChecked(m, true);
         }
 
         List<IRepositoryModel> allRepositories = SigilCore.getRepositoryConfiguration().loadRepositories();
 
-        for ( IRepositoryModel m : allRepositories )
+        for (IRepositoryModel m : allRepositories)
         {
-            if ( !repositories.contains( m ) )
+            if (!repositories.contains(m))
             {
-                repositories.add( m );
+                repositories.add(m);
             }
         }
 
         viewer.refresh();
     }
 
-
-    private void setUpDownEnabled( boolean enabled )
+    private void setUpDownEnabled(boolean enabled)
     {
-        upBtn.setEnabled( enabled );
-        downBtn.setEnabled( enabled );
+        upBtn.setEnabled(enabled);
+        downBtn.setEnabled(enabled);
     }
 
-
     private List<IRepositoryModel> getRepositories()
     {
         ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
 
-        for ( IRepositoryModel m : repositories )
+        for (IRepositoryModel m : repositories)
         {
-            if ( viewer.getChecked( m ) )
+            if (viewer.getChecked(m))
             {
-                reps.add( m );
+                reps.add(m);
             }
         }
 



Mime
View raw message