ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r814208 - in /ant/ivy/ivyde/trunk: ./ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/
Date Sat, 12 Sep 2009 17:38:18 GMT
Author: hibou
Date: Sat Sep 12 17:38:17 2009
New Revision: 814208

URL: http://svn.apache.org/viewvc?rev=814208&view=rev
Log:
Add option to not launch a resolve after saving a file with the IvyEditor (IVYDE-197) (thanks
to Jon Schneider)

Modified:
    ant/ivy/ivyde/trunk/CHANGES.txt
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java

Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Sat Sep 12 17:38:17 2009
@@ -5,6 +5,7 @@
 ==========================
 - NEW: Inclusion of Ivy related schemas into the Eclipse XML Catalog (IVYDE-190) (thanks
to Miguel Griffa)
 - NEW: Add "Resolve Dependencies" extension to Java Project in the Package Explorer (IVYDE-153)
(thanks to Jon Schneider and Troy Gaines)
+- NEW: Add option to not launch a resolve after saving a file with the IvyEditor (IVYDE-197)
(thanks to Jon Schneider)
 
 - FIX: "Ivy Settings Path" Browse button results in an incorrectly formatted URL (IVYDE-191)
(thanks to Jon Schneider)
 - FIX: Workspace Resolver Prevents Source Download (IVYDE-188) (thanks to Phillip Webb)

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/editors/IvyModuleDescriptorEditor.java
Sat Sep 12 17:38:17 2009
@@ -166,9 +166,11 @@
         List/* <IvyClasspathContainer> */containers = IvyClasspathUtil
                 .getIvyFileClasspathContainers(file);
         Iterator/* <IvyClasspathContainer> */itContainers = containers.iterator();
-        while (itContainers.hasNext()) {
-            IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainers.next();
-            ivycp.launchResolve(false, true, null);
+        if (IvyPlugin.getPreferenceStoreHelper().getAutoResolveOnChange()) {
+            while (itContainers.hasNext()) {
+                IvyClasspathContainer ivycp = (IvyClasspathContainer) itContainers.next();
+                ivycp.launchResolve(false, true, null);
+            }
         }
     }
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
Sat Sep 12 17:38:17 2009
@@ -211,4 +211,11 @@
         prefStore.setValue(PreferenceConstants.AUTO_RESOLVE_ON_OPEN, autoResolveOnOpen);
     }
 
+    public boolean getAutoResolveOnChange() {
+        return prefStore.getBoolean(PreferenceConstants.AUTO_RESOLVE_ON_CHANGE);
+    }
+
+    public void setAutoResolveOnChange(boolean autoResolveChange) {
+        prefStore.setValue(PreferenceConstants.AUTO_RESOLVE_ON_CHANGE, autoResolveChange);
+    }
 }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
Sat Sep 12 17:38:17 2009
@@ -57,7 +57,11 @@
 
     private Button resolveOnStartupButton;
 
-    private Button doNothingButton;
+    private Button doNothingOnStartupButton;
+
+    private Button resolveOnChangeButton;
+
+    private Button doNothingOnChangeButton;
 
     public IvyPreferencePage() {
         setPreferenceStore(IvyPlugin.getDefault().getPreferenceStore());
@@ -86,9 +90,10 @@
         startupGroup.setLayout(new GridLayout());
         startupGroup.setText("On Eclipse startup");
 
-        doNothingButton = new Button(startupGroup, SWT.RADIO);
-        doNothingButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-        doNothingButton.setText("Do nothing");
+        doNothingOnStartupButton = new Button(startupGroup, SWT.RADIO);
+        doNothingOnStartupButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
true,
+                false));
+        doNothingOnStartupButton.setText("Do nothing");
 
         refreshOnStartupButton = new Button(startupGroup, SWT.RADIO);
         refreshOnStartupButton
@@ -100,6 +105,21 @@
                 .setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
         resolveOnStartupButton.setText("Trigger resolve");
 
+        Group fileChangeGroup = new Group(composite, SWT.NONE);
+        fileChangeGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+        fileChangeGroup.setLayout(new GridLayout());
+        fileChangeGroup.setText("On Ivy File Change");
+
+        doNothingOnChangeButton = new Button(fileChangeGroup, SWT.RADIO);
+        doNothingOnChangeButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
true,
+                false));
+        doNothingOnChangeButton.setText("Do nothing");
+
+        resolveOnChangeButton = new Button(fileChangeGroup, SWT.RADIO);
+        resolveOnChangeButton
+                .setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+        resolveOnChangeButton.setText("Trigger resolve");
+
         Group editorGroup = new Group(composite, SWT.NONE);
         editorGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
3, 1));
         editorGroup.setLayout(new GridLayout(2, false));
@@ -127,7 +147,7 @@
         IvyDEPreferenceStoreHelper helper = IvyPlugin.getPreferenceStoreHelper();
         switch (helper.getResolveOnStartup()) {
             case IvyClasspathInitializer.ON_STARTUP_NOTHING:
-                doNothingButton.setSelection(true);
+                doNothingOnStartupButton.setSelection(true);
                 break;
             case IvyClasspathInitializer.ON_STARTUP_REFRESH:
                 refreshOnStartupButton.setSelection(true);
@@ -136,19 +156,34 @@
                 resolveOnStartupButton.setSelection(true);
                 break;
         }
+
+        if (helper.getAutoResolveOnChange()) {
+            resolveOnChangeButton.setSelection(true);
+        } else {
+            doNothingOnChangeButton.setSelection(true);
+        }
+
         organizationText.setText(helper.getIvyOrg());
         organizationUrlText.setText(helper.getIvyOrgUrl());
     }
 
     public boolean performOk() {
         IvyDEPreferenceStoreHelper helper = IvyPlugin.getPreferenceStoreHelper();
-        if (doNothingButton.getSelection()) {
+
+        if (doNothingOnStartupButton.getSelection()) {
             helper.setResolveOnStartup(IvyClasspathInitializer.ON_STARTUP_NOTHING);
         } else if (refreshOnStartupButton.getSelection()) {
             helper.setResolveOnStartup(IvyClasspathInitializer.ON_STARTUP_REFRESH);
         } else {
             helper.setResolveOnStartup(IvyClasspathInitializer.ON_STARTUP_RESOLVE);
         }
+
+        if (resolveOnChangeButton.getSelection()) {
+            helper.setAutoResolveOnChange(true);
+        } else {
+            helper.setAutoResolveOnChange(false);
+        }
+
         helper.setOrganization(organizationText.getText());
         helper.setOrganizationUrl(organizationUrlText.getText());
         return true;
@@ -157,7 +192,7 @@
     protected void performDefaults() {
         switch (PreferenceInitializer.DEFAULT_RESOLVE_ON_STARTUP) {
             case IvyClasspathInitializer.ON_STARTUP_NOTHING:
-                doNothingButton.setSelection(true);
+                doNothingOnStartupButton.setSelection(true);
                 break;
             case IvyClasspathInitializer.ON_STARTUP_REFRESH:
                 refreshOnStartupButton.setSelection(true);
@@ -166,6 +201,13 @@
                 resolveOnStartupButton.setSelection(true);
                 break;
         }
+
+        if (PreferenceInitializer.DEFAULT_AUTO_RESOLVE_ON_CHANGE) {
+            resolveOnChangeButton.setSelection(true);
+        } else {
+            doNothingOnChangeButton.setSelection(true);
+        }
+
         organizationText.setText(PreferenceInitializer.DEFAULT_ORGANISATION);
         organizationUrlText.setText(PreferenceInitializer.DEFAULT_ORGANISATION_URL);
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
Sat Sep 12 17:38:17 2009
@@ -76,4 +76,5 @@
 
     public static final String AUTO_RESOLVE_ON_CLOSE = "autoResolve.close";
 
+    public static final String AUTO_RESOLVE_ON_CHANGE = "autoResolve.change";
 }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java?rev=814208&r1=814207&r2=814208&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
(original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
Sat Sep 12 17:38:17 2009
@@ -66,6 +66,8 @@
 
     public static final boolean DEFAULT_AUTO_RESOLVE_ON_OPEN = false;
 
+    public static final boolean DEFAULT_AUTO_RESOLVE_ON_CHANGE = true;
+    
     public void initializeDefaultPreferences() {
         IPreferenceStore store = IvyPlugin.getDefault().getPreferenceStore();
         store.setDefault(PreferenceConstants.P_BOOLEAN, true);
@@ -111,6 +113,7 @@
 
         store.setDefault(PreferenceConstants.AUTO_RESOLVE_ON_CLOSE, DEFAULT_AUTO_RESOLVE_ON_CLOSE);
         store.setDefault(PreferenceConstants.AUTO_RESOLVE_ON_OPEN, DEFAULT_AUTO_RESOLVE_ON_OPEN);
+        store.setDefault(PreferenceConstants.AUTO_RESOLVE_ON_CHANGE, DEFAULT_AUTO_RESOLVE_ON_CHANGE);
     }
 
 }



Mime
View raw message