felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r967025 - in /felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui: editors/project/ExportPackagesSection.java preferences/OptionalPrompt.java util/ProjectUtils.java
Date Fri, 23 Jul 2010 10:29:26 GMT
Author: dsavage
Date: Fri Jul 23 10:29:25 2010
New Revision: 967025

URL: http://svn.apache.org/viewvc?rev=967025&view=rev
Log:
add overloaded optiol prompt util methods to avoid need to pass usually redundant pref store
param

Modified:
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/OptionalPrompt.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ProjectUtils.java

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java?rev=967025&r1=967024&r2=967025&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/editors/project/ExportPackagesSection.java
Fri Jul 23 10:29:25 2010
@@ -112,8 +112,7 @@ public class ExportPackagesSection exten
                 // Add corresponding imports (maybe)
                 boolean importsAdded = false;
 
-                IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
-                boolean shouldAddImports = OptionalPrompt.optionallyPrompt( store,
+                boolean shouldAddImports = OptionalPrompt.optionallyPrompt(
                     SigilCore.PREFERENCES_ADD_IMPORT_FOR_EXPORT, "Add Exports",
                     "Should corresponding imports be added?", getSection().getShell() );
                 if ( shouldAddImports )
@@ -199,8 +198,7 @@ public class ExportPackagesSection exten
         {
             boolean importsRemoved = false;
 
-            IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
-            boolean shouldRemoveImports = OptionalPrompt.optionallyPrompt( store,
+            boolean shouldRemoveImports = OptionalPrompt.optionallyPrompt( 
                 SigilCore.PREFERENCES_REMOVE_IMPORT_FOR_EXPORT, "Remove Exports",
                 "Should corresponding imports be removed?", getSection().getShell() );
             

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/OptionalPrompt.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/OptionalPrompt.java?rev=967025&r1=967024&r2=967025&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/OptionalPrompt.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/preferences/OptionalPrompt.java
Fri Jul 23 10:29:25 2010
@@ -20,6 +20,7 @@
 package org.apache.felix.sigil.ui.eclipse.ui.preferences;
 
 
+import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.preferences.PromptablePreference;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -29,6 +30,11 @@ import org.eclipse.swt.widgets.Shell;
 
 public class OptionalPrompt
 {
+    public static boolean optionallyPrompt( String prefName, String title, String text, Shell
parentShell) 
+    {
+        return optionallyPrompt(SigilCore.getDefault().getPreferenceStore(), prefName, title,
text, parentShell);
+    }
+    
     public static boolean optionallyPrompt( IPreferenceStore prefStore, String prefName,
String title, String text,
         Shell parentShell )
     {
@@ -58,7 +64,12 @@ public class OptionalPrompt
         return result;
     }
 
-
+    public static int optionallyPromptWithCancel( String prefName, String title,
+        String text, Shell parentShell )
+    {
+        return optionallyPromptWithCancel(SigilCore.getDefault().getPreferenceStore(), prefName,
title, text, parentShell);
+    }
+    
     public static int optionallyPromptWithCancel( IPreferenceStore prefStore, String prefName,
String title,
         String text, Shell parentShell )
     {

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ProjectUtils.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ProjectUtils.java?rev=967025&r1=967024&r2=967025&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ProjectUtils.java
(original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/ui/eclipse/ui/util/ProjectUtils.java
Fri Jul 23 10:29:25 2010
@@ -94,7 +94,7 @@ public class ProjectUtils
         }
         else
         {
-            return OptionalPrompt.optionallyPromptWithCancel( SigilCore.getDefault().getPreferenceStore(),
+            return OptionalPrompt.optionallyPromptWithCancel(
                 SigilCore.PREFERENCES_REBUILD_PROJECTS, "Rebuild", "Do you wish to rebuild
all Sigil projects", shell );
         }
     }



Mime
View raw message