You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2009/01/05 15:19:20 UTC
svn commit: r731581 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse: ./
src/java/org/apache/ivyde/eclipse/cpcontainer/
src/java/org/apache/ivyde/eclipse/ui/
src/java/org/apache/ivyde/eclipse/ui/actions/
src/java/org/apache/ivyde/eclipse/ui/preferences/
Author: hibou
Date: Mon Jan 5 06:19:20 2009
New Revision: 731581
URL: http://svn.apache.org/viewvc?rev=731581&view=rev
Log:
IVYDE-26:
- now the settings are always reloaded by default
- add an option to only reload it on demand
- new entry in the context menu to reload the settings
Added:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java (with props)
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.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
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/CHANGES.txt Mon Jan 5 06:19:20 2009
@@ -6,6 +6,7 @@
- NEW: Add the IvyDE documentation to the Eclipse help (IVYDE-150)
- NEW: Export IVY_HOME as a classpath variable (IVYDE-141)
- NEW: Support variables in ivyconf.xml (IVYDE-13) (thanks to Will Gorman)
+- NEW: Allow to manually reload the settings (IVYDE-26)
- FIX: When migrating from ivyde alpha to ivyde beta eclipse is throwing NPE at startup (IVYDE-136) (thanks to Daniel Becheanu)
- FIX: The retrieve configuration doesn't support '*' as accepted types (IVYDE-137) (thanks to Daniel Becheanu)
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml Mon Jan 5 06:19:20 2009
@@ -58,7 +58,18 @@
</classpathContainerInitializer>
</extension>
- <extension point="org.eclipse.ui.popupMenus">
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="false"
+ id="org.apache.ivyde.eclipse.ui.actions.ReloadSettingsAction"
+ objectClass="org.eclipse.jdt.internal.ui.packageview.ClassPathContainer">
+ <action
+ class="org.apache.ivyde.eclipse.ui.actions.ReloadSettingsAction"
+ enablesFor="1"
+ id="org.apache.ivyde.eclipse.ui.actions.ReloadSettingsAction"
+ label="Reload &settings">
+ </action>
+ </objectContribution>
<objectContribution
id="org.apache.ivyde.eclipse.ui.actions.RefreshAction"
objectClass="org.eclipse.jdt.internal.ui.packageview.ClassPathContainer">
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java Mon Jan 5 06:19:20 2009
@@ -263,4 +263,9 @@
job = null;
}
+ public void reloadSettings() {
+ conf.ivySettingsLastModified = -1;
+ launchResolve(false, true, null);
+ }
+
}
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java Mon Jan 5 06:19:20 2009
@@ -118,6 +118,8 @@
boolean isSettingsSpecific;
+ boolean loadSettingsOnDemand = false;
+
/**
* Constructor
*
@@ -214,6 +216,9 @@
} else if (parameter[0].equals("ivySettingsPath")) {
ivySettingsPath = readOldIvySettings(value);
isSettingsSpecific = true;
+ } else if (parameter[0].equals("loadSettingsOnDemand")) {
+ loadSettingsOnDemand = Boolean.valueOf(value).booleanValue();
+ isSettingsSpecific = true;
} else if (parameter[0].equals("propertyFiles")) {
propertyFiles = IvyClasspathUtil.split(value);
isSettingsSpecific = true;
@@ -332,6 +337,8 @@
if (isSettingsSpecific) {
path.append("&ivySettingsPath=");
path.append(URLEncoder.encode(ivySettingsPath, "UTF-8"));
+ path.append("&loadSettingsOnDemand=");
+ path.append(URLEncoder.encode(Boolean.toString(loadSettingsOnDemand), "UTF-8"));
path.append("&propertyFiles=");
path.append(URLEncoder.encode(IvyClasspathUtil.concat(propertyFiles), "UTF-8"));
}
@@ -551,7 +558,7 @@
throw ex;
}
- if (file.lastModified() != ivySettingsLastModified) {
+ if (file.lastModified() != ivySettingsLastModified || !getInheritedLoadSettingsOnDemandPath()) {
IvySettings ivySettings = createIvySettings();
if (ivySettingsLastModified == -1) {
Message.info("\n\n");
@@ -641,6 +648,13 @@
return ivySettingsPath;
}
+ public boolean getInheritedLoadSettingsOnDemandPath() {
+ if (!isSettingsSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().isLoadSettingsOnDemand();
+ }
+ return loadSettingsOnDemand;
+ }
+
public boolean getInheritedDoRetrieve() {
if (javaProject == null) {
// no project means no retrieve possible
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java Mon Jan 5 06:19:20 2009
@@ -129,7 +129,9 @@
}
if (settingsProjectSpecificButton.getSelection()) {
+ conf.isSettingsSpecific = true;
conf.ivySettingsPath = settingsEditor.getSettingsPath();
+ conf.loadSettingsOnDemand = settingsEditor.isLoadOnDemand();
conf.propertyFiles = settingsEditor.getPropertyFiles();
conf.acceptedTypes = acceptedSuffixesTypesComposite.getAcceptedTypes();
conf.sourceTypes = acceptedSuffixesTypesComposite.getSourcesTypes();
@@ -144,7 +146,7 @@
conf.alphaOrder = alphaOrderCheck.getSelectionIndex() == 1;
conf.resolveInWorkspace = resolveInWorkspaceCheck.getSelection();
} else {
- conf.ivySettingsPath = null;
+ conf.isSettingsSpecific = false;
}
if (retrieveProjectSpecificButton.getSelection()) {
conf.isRetrieveProjectSpecific = true;
@@ -432,10 +434,12 @@
if (conf.isSettingsProjectSpecific()) {
settingsProjectSpecificButton.setSelection(true);
- settingsEditor.init(conf.ivySettingsPath, conf.propertyFiles);
+ settingsEditor
+ .init(conf.ivySettingsPath, conf.propertyFiles, conf.loadSettingsOnDemand);
} else {
settingsProjectSpecificButton.setSelection(false);
- settingsEditor.init(helper.getIvySettingsPath(), helper.getPropertyFiles());
+ settingsEditor.init(helper.getIvySettingsPath(), helper.getPropertyFiles(), helper
+ .isLoadSettingsOnDemand());
}
if (conf.isRetrieveProjectSpecific()) {
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java?rev=731581&r1=731580&r2=731581&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java Mon Jan 5 06:19:20 2009
@@ -67,6 +67,8 @@
private Text propFilesText;
+ private Button loadOnDemandButton;
+
public SettingsEditor(Composite parent, int style) {
super(parent, style);
GridLayout layout = new GridLayout(3, false);
@@ -129,6 +131,10 @@
}
});
+ loadOnDemandButton = new Button(this, SWT.CHECK);
+ loadOnDemandButton.setText("reload the settings only on demand");
+ loadOnDemandButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
+
label = new Label(this, SWT.NONE);
label.setText("Property files:");
@@ -146,6 +152,10 @@
return settingsText.getText();
}
+ public boolean isLoadOnDemand() {
+ return loadOnDemandButton.getSelection();
+ }
+
public List getPropertyFiles() {
return IvyClasspathUtil.split(propFilesText.getText());
}
@@ -215,19 +225,21 @@
return null;
}
- public void init(String ivySettingsPath, String propertyFiles) {
+ public void init(String ivySettingsPath, String propertyFiles, boolean loadOnDemand) {
settingsText.setText(ivySettingsPath);
propFilesText.setText(propertyFiles);
+ loadOnDemandButton.setSelection(loadOnDemand);
}
- public void init(String ivySettingsPath, List propertyFiles) {
- init(ivySettingsPath, IvyClasspathUtil.concat(propertyFiles));
+ public void init(String ivySettingsPath, List propertyFiles, boolean loadOnDemand) {
+ init(ivySettingsPath, IvyClasspathUtil.concat(propertyFiles), loadOnDemand);
}
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
settingsText.setEnabled(enabled);
propFilesText.setEnabled(enabled);
+ loadOnDemandButton.setEnabled(enabled);
}
}
Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java?rev=731581&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java Mon Jan 5 06:19:20 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.ui.actions;
+
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.eclipse.jface.action.IAction;
+
+public class ReloadSettingsAction extends IvyDEContainerAction {
+
+ private IvyClasspathContainer cp;
+
+ protected void selectionChanged(IAction a, IvyClasspathContainer ivycp) {
+ this.cp = ivycp;
+ }
+
+ public void run(IAction action) {
+ cp.reloadSettings();
+ }
+
+}
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/actions/ReloadSettingsAction.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
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=731581&r1=731580&r2=731581&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 Mon Jan 5 06:19:20 2009
@@ -54,9 +54,11 @@
public static final boolean DEFAULT_ALPHABETICAL_ORDER = false;
public static final boolean DEFAULT_RESOLVE_IN_WORKSPACE = false;
-
+
public static final String DEFAULT_PROPERTY_FILES = "";
+ public static final boolean DEFAULT_LOAD_SETTINGS_ON_DEMAND = false;
+
private final IPreferenceStore prefStore;
public IvyDEPreferenceStoreHelper(IPreferenceStore prefStore) {
@@ -99,6 +101,8 @@
prefStore
.setDefault(PreferenceConstants.RESOLVE_IN_WORKSPACE, DEFAULT_RESOLVE_IN_WORKSPACE);
prefStore.setDefault(PreferenceConstants.PROPERTY_FILES, DEFAULT_PROPERTY_FILES);
+ prefStore.setDefault(PreferenceConstants.LOAD_SETTINGS_ON_DEMAND,
+ DEFAULT_LOAD_SETTINGS_ON_DEMAND);
}
public String getIvyOrg() {
@@ -130,7 +134,8 @@
}
public void setAcceptedTypes(Collection acceptedTypes) {
- prefStore.setValue(PreferenceConstants.ACCEPTED_TYPES, IvyClasspathUtil.concat(acceptedTypes));
+ prefStore.setValue(PreferenceConstants.ACCEPTED_TYPES, IvyClasspathUtil
+ .concat(acceptedTypes));
}
public List getSourceTypes() {
@@ -146,7 +151,8 @@
}
public void setJavadocTypes(Collection javadocTypes) {
- prefStore.setValue(PreferenceConstants.JAVADOC_TYPES, IvyClasspathUtil.concat(javadocTypes));
+ prefStore
+ .setValue(PreferenceConstants.JAVADOC_TYPES, IvyClasspathUtil.concat(javadocTypes));
}
public List getSourceSuffixes() {
@@ -154,7 +160,8 @@
}
public void setSourceSuffixes(Collection sourceSuffixes) {
- prefStore.setValue(PreferenceConstants.SOURCES_SUFFIXES, IvyClasspathUtil.concat(sourceSuffixes));
+ prefStore.setValue(PreferenceConstants.SOURCES_SUFFIXES, IvyClasspathUtil
+ .concat(sourceSuffixes));
}
public List getJavadocSuffixes() {
@@ -162,7 +169,8 @@
}
public void setJavadocSuffixes(Collection javadocSuffixes) {
- prefStore.setValue(PreferenceConstants.JAVADOC_SUFFIXES, IvyClasspathUtil.concat(javadocSuffixes));
+ prefStore.setValue(PreferenceConstants.JAVADOC_SUFFIXES, IvyClasspathUtil
+ .concat(javadocSuffixes));
}
public boolean getDoRetrieve() {
@@ -238,10 +246,19 @@
}
public List getPropertyFiles() {
- return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.PROPERTY_FILES));
+ return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.PROPERTY_FILES));
}
public void setPropertyFiles(List files) {
prefStore.setValue(PreferenceConstants.PROPERTY_FILES, IvyClasspathUtil.concat(files));
}
+
+ public boolean isLoadSettingsOnDemand() {
+ return prefStore.getBoolean(PreferenceConstants.LOAD_SETTINGS_ON_DEMAND);
+ }
+
+ public void setLoadSettingsOnDemand(boolean onDemand) {
+ prefStore.setValue(PreferenceConstants.LOAD_SETTINGS_ON_DEMAND, onDemand);
+ }
+
}
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=731581&r1=731580&r2=731581&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 Mon Jan 5 06:19:20 2009
@@ -156,7 +156,8 @@
private void initPreferences() {
IvyDEPreferenceStoreHelper helper = IvyPlugin.getPreferenceStoreHelper();
- settingsEditor.init(helper.getIvySettingsPath(), helper.getPropertyFiles());
+ settingsEditor.init(helper.getIvySettingsPath(), helper.getPropertyFiles(), helper
+ .isLoadSettingsOnDemand());
retrieveComposite.init(helper.getDoRetrieve(), helper.getRetrievePattern(), helper
.getRetrieveConfs(), helper.getRetrieveTypes(), helper.getRetrieveSync());
resolveInWorkspaceCheck.setSelection(helper.isResolveInWorkspace());
@@ -190,7 +191,8 @@
protected void performDefaults() {
settingsEditor.init(IvyDEPreferenceStoreHelper.DEFAULT_IVYSETTINGS_PATH,
- IvyDEPreferenceStoreHelper.DEFAULT_PROPERTY_FILES);
+ IvyDEPreferenceStoreHelper.DEFAULT_PROPERTY_FILES,
+ IvyDEPreferenceStoreHelper.DEFAULT_LOAD_SETTINGS_ON_DEMAND);
retrieveComposite.init(IvyDEPreferenceStoreHelper.DEFAULT_DO_RETRIEVE,
IvyDEPreferenceStoreHelper.DEFAULT_RETRIEVE_PATTERN,
IvyDEPreferenceStoreHelper.DEFAULT_RETRIEVE_CONFS,
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=731581&r1=731580&r2=731581&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 Mon Jan 5 06:19:20 2009
@@ -68,4 +68,6 @@
public static final String PROPERTY_FILES = "propertyFiles";
+ public static final String LOAD_SETTINGS_ON_DEMAND = "loadSettingsOnDemand";
+
}