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 2010/08/23 13:47:36 UTC
svn commit: r988089 - in
/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse:
cpcontainer/ ui/ ui/preferences/
Author: hibou
Date: Mon Aug 23 11:47:35 2010
New Revision: 988089
URL: http://svn.apache.org/viewvc?rev=988089&view=rev
Log:
IVYDE-56: start actually the implementation
* add some UI and preferences to have a retrieved classpath
Added:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java (with props)
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.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/RetrieveComposite.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/ClasspathPreferencePage.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/EditStandaloneRetrieveDialog.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/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/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java?rev=988089&r1=988088&r2=988089&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java Mon Aug 23 11:47:35 2010
@@ -98,6 +98,7 @@ public final class IvyClasspathContainer
private static void loadV1(IvyClasspathContainerConfiguration conf, IPath path) {
ContainerMappingSetup mappingSetup = conf.getContainerMappingSetup();
IvySettingsSetup settingsSetup = conf.getIvySettingsSetup();
+ RetrieveSetup retrievedClasspathSetup = conf.getRetrievedClasspathSetup();
String url = path.segment(1).substring(1);
String[] parameters = url.split("&");
@@ -107,7 +108,7 @@ public final class IvyClasspathContainer
String ivyXmlPath = "ivy.xml";
boolean doStandaloneRetrieve = false;
boolean isRetrieveProjectSpecific = false;
- RetrieveSetup retrieveSetup = new RetrieveSetup();
+ RetrieveSetup standaloneRetrieveSetup = new RetrieveSetup();
for (int i = 0; i < parameters.length; i++) {
String[] parameter = parameters[i].split("=");
@@ -166,6 +167,18 @@ public final class IvyClasspathContainer
} else if (parameter[0].equals("resolveBeforeLaunch")) {
conf.setResolveBeforeLaunch(Boolean.valueOf(value).booleanValue());
conf.setAdvancedProjectSpecific(true);
+ } else if (parameter[0].equals("retrievedClasspath")) {
+ conf.setRetrievedClasspath(Boolean.valueOf(value).booleanValue());
+ conf.setAdvancedProjectSpecific(true);
+ } else if (parameter[0].equals("retrievedClasspathPattern")) {
+ retrievedClasspathSetup.setRetrievePattern(value);
+ conf.setAdvancedProjectSpecific(true);
+ } else if (parameter[0].equals("retrievedClasspathSync")) {
+ retrievedClasspathSetup.setRetrieveSync(Boolean.valueOf(value).booleanValue());
+ conf.setAdvancedProjectSpecific(true);
+ } else if (parameter[0].equals("retrievedClasspathTypes")) {
+ retrievedClasspathSetup.setRetrieveTypes(value);
+ conf.setAdvancedProjectSpecific(true);
// the following is the retrieve conf pre -IVYDE-56
// from this conf should be build StandaloneRetrieveSetup
@@ -176,16 +189,16 @@ public final class IvyClasspathContainer
doStandaloneRetrieve = Boolean.valueOf(value).booleanValue();
isRetrieveProjectSpecific = true;
} else if (parameter[0].equals("retrievePattern")) {
- retrieveSetup.setRetrievePattern(value);
+ standaloneRetrieveSetup.setRetrievePattern(value);
isRetrieveProjectSpecific = true;
} else if (parameter[0].equals("retrieveSync")) {
- retrieveSetup.setRetrieveSync(Boolean.valueOf(value).booleanValue());
+ standaloneRetrieveSetup.setRetrieveSync(Boolean.valueOf(value).booleanValue());
isRetrieveProjectSpecific = true;
} else if (parameter[0].equals("retrieveConfs")) {
- retrieveSetup.setRetrieveConfs(value);
+ standaloneRetrieveSetup.setRetrieveConfs(value);
isRetrieveProjectSpecific = true;
} else if (parameter[0].equals("retrieveTypes")) {
- retrieveSetup.setRetrieveTypes(value);
+ standaloneRetrieveSetup.setRetrieveTypes(value);
isRetrieveProjectSpecific = true;
}
}
@@ -196,7 +209,7 @@ public final class IvyClasspathContainer
// convert pre IVYDE-56 conf
convertOldRetrieveConf(conf, isRetrieveProjectSpecific, doStandaloneRetrieve,
- retrieveSetup, settingsSetup, ivyXmlPath);
+ standaloneRetrieveSetup, settingsSetup, ivyXmlPath);
}
private static void convertOldRetrieveConf(IvyClasspathContainerConfiguration conf,
@@ -350,6 +363,13 @@ public final class IvyClasspathContainer
append(path, "alphaOrder", conf.isAlphaOrder());
append(path, "resolveInWorkspace", conf.isResolveInWorkspace());
append(path, "resolveBeforeLaunch", conf.isResolveBeforeLaunch());
+ append(path, "retrievedClasspath", conf.isRetrievedClasspath());
+ if (conf.isRetrievedClasspath()) {
+ RetrieveSetup retrieveSetup = conf.getRetrievedClasspathSetup();
+ append(path, "retrievedClasspathPattern", retrieveSetup.getRetrievePattern());
+ append(path, "retrievedClasspathSync", retrieveSetup.isRetrieveSync());
+ append(path, "retrievedClasspathTypes", retrieveSetup.getRetrieveTypes());
+ }
}
} catch (UnsupportedEncodingException e) {
IvyPlugin.log(IStatus.ERROR, UTF8_ERROR, e);
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=988089&r1=988088&r2=988089&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 Aug 23 11:47:35 2010
@@ -23,6 +23,7 @@ import java.util.List;
import org.apache.ivyde.eclipse.IvyDEException;
import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.retrieve.RetrieveSetup;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IJavaProject;
@@ -58,6 +59,10 @@ public class IvyClasspathContainerConfig
*/
private IClasspathAttribute[] attributes = new IClasspathAttribute[0];
+ private boolean retrievedClasspath;
+
+ private RetrieveSetup retrievedClasspathSetup = new RetrieveSetup();
+
/**
* Constructor
*
@@ -181,6 +186,22 @@ public class IvyClasspathContainerConfig
return attributes;
}
+ public boolean isRetrievedClasspath() {
+ return retrievedClasspath;
+ }
+
+ public void setRetrievedClasspath(boolean retrievedClasspath) {
+ this.retrievedClasspath = retrievedClasspath;
+ }
+
+ public RetrieveSetup getRetrievedClasspathSetup() {
+ return retrievedClasspathSetup;
+ }
+
+ public void setRetrievedClasspathSetup(RetrieveSetup retrievedClasspathSetup) {
+ this.retrievedClasspathSetup = retrievedClasspathSetup;
+ }
+
// ///////////////////////////
// Getters that take into account the global preferences
// ///////////////////////////
@@ -270,6 +291,20 @@ public class IvyClasspathContainerConfig
return resolveBeforeLaunch;
}
+ public boolean isInheritedRetrievedClasspath() {
+ if (!isAdvancedProjectSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().isRetrievedClasspath();
+ }
+ return retrievedClasspath;
+ }
+
+ public RetrieveSetup getInheritedRetrievedClasspathSet() {
+ if (!isAdvancedProjectSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().getRetrievedClasspathSetup();
+ }
+ return retrievedClasspathSetup;
+ }
+
public String toString() {
return ivyXmlPath + confs
+ (javaProject == null ? "" : " in '" + javaProject.getProject().getName() + "'");
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=988089&r1=988088&r2=988089&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 Aug 23 11:47:35 2010
@@ -27,6 +27,7 @@ import org.apache.ivyde.eclipse.FakeProj
import org.apache.ivyde.eclipse.IvyDEException;
import org.apache.ivyde.eclipse.IvyPlugin;
import org.apache.ivyde.eclipse.ui.AcceptedSuffixesTypesComposite;
+import org.apache.ivyde.eclipse.ui.ClasspathTypeComposite;
import org.apache.ivyde.eclipse.ui.ConfTableViewer;
import org.apache.ivyde.eclipse.ui.IvyFilePathText;
import org.apache.ivyde.eclipse.ui.IvySettingsTab;
@@ -102,6 +103,8 @@ public class IvydeContainerPage extends
private IvySettingsTab settingsTab;
+ private ClasspathTypeComposite classpathTypeComposite;
+
/**
* Constructor
*/
@@ -205,6 +208,10 @@ public class IvydeContainerPage extends
conf.setAlphaOrder(alphaOrderCheck.getSelectionIndex() == 1);
conf.setResolveInWorkspace(resolveInWorkspaceCheck.getSelection());
conf.setResolveBeforeLaunch(resolveBeforeLaunchCheck.getSelection());
+ conf.setRetrievedClasspath(classpathTypeComposite.isRetrievedClasspath());
+ if (classpathTypeComposite.isRetrievedClasspath()) {
+ conf.setRetrievedClasspathSetup(classpathTypeComposite.getRetrieveSetup());
+ }
} else {
conf.setAdvancedProjectSpecific(false);
}
@@ -429,6 +436,10 @@ public class IvydeContainerPage extends
acceptedSuffixesTypesComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
true, false, 3, 1));
+ classpathTypeComposite = new ClasspathTypeComposite(composite, SWT.NONE);
+ classpathTypeComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
+ false, 3, 1));
+
return composite;
}
@@ -446,12 +457,16 @@ public class IvydeContainerPage extends
alphaOrderCheck.select(conf.isAlphaOrder() ? 1 : 0);
resolveInWorkspaceCheck.setSelection(conf.isResolveInWorkspace());
resolveBeforeLaunchCheck.setSelection(conf.isResolveBeforeLaunch());
+ classpathTypeComposite.init(conf.isRetrievedClasspath(), conf
+ .getRetrievedClasspathSetup());
} else {
advancedProjectSpecificButton.setSelection(false);
acceptedSuffixesTypesComposite.init(helper.getContainerMappingSetup());
alphaOrderCheck.select(helper.isAlphOrder() ? 1 : 0);
resolveInWorkspaceCheck.setSelection(helper.isResolveInWorkspace());
resolveBeforeLaunchCheck.setSelection(helper.isResolveBeforeLaunch());
+ classpathTypeComposite.init(helper.isRetrievedClasspath(), helper
+ .getRetrievedClasspathSetup());
}
settingsTab.updateFieldsStatusSettings();
@@ -466,6 +481,7 @@ public class IvydeContainerPage extends
alphaOrderCheck.setEnabled(projectSpecific);
resolveInWorkspaceCheck.setEnabled(projectSpecific);
resolveBeforeLaunchCheck.setEnabled(projectSpecific);
+ classpathTypeComposite.setEnabled(projectSpecific);
}
public void initialize(IJavaProject p, IClasspathEntry[] currentEntries) {
Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java?rev=988089&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java Mon Aug 23 11:47:35 2010
@@ -0,0 +1,87 @@
+/*
+ * 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;
+
+import org.apache.ivyde.eclipse.retrieve.RetrieveSetup;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class ClasspathTypeComposite extends Composite {
+
+ private static final int INDENT_BUTTONS = 0;
+
+ private static final int INDENT_RETRIEVE = 60;
+
+ private Button selectRetrieve;
+
+ private RetrieveComposite retrieveComposite;
+
+ private Button selectCache;
+
+ public ClasspathTypeComposite(Composite parent, int style) {
+ super(parent, style);
+ setLayout(new GridLayout(1, false));
+
+ Label label = new Label(this, SWT.NONE);
+ label.setText("Compose the classpath with:");
+
+ Composite buttons = new Composite(this, SWT.NONE);
+ buttons.setLayout(new GridLayout(1, false));
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalIndent = INDENT_BUTTONS;
+ buttons.setLayoutData(gridData);
+
+ selectCache = new Button(buttons, SWT.RADIO);
+ selectCache.setText("Ivy's cache");
+
+ selectRetrieve = new Button(buttons, SWT.RADIO);
+ selectRetrieve.setText("retrieved artifacts");
+
+ retrieveComposite = new RetrieveComposite(this, SWT.NONE, false);
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalIndent = INDENT_RETRIEVE;
+ retrieveComposite.setLayoutData(gridData);
+
+ selectRetrieve.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ retrieveComposite.setEnabled(selectRetrieve.getSelection());
+ }
+ });
+ }
+
+ public void init(boolean retrievedClasspath, RetrieveSetup retrieveSetup) {
+ selectCache.setSelection(!retrievedClasspath);
+ selectRetrieve.setSelection(retrievedClasspath);
+ retrieveComposite.init(retrieveSetup);
+ retrieveComposite.setEnabled(retrievedClasspath);
+ }
+
+ public boolean isRetrievedClasspath() {
+ return selectRetrieve.getSelection();
+ }
+
+ public RetrieveSetup getRetrieveSetup() {
+ return retrieveComposite.getRetrieveSetup();
+ }
+}
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ClasspathTypeComposite.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/RetrieveComposite.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/RetrieveComposite.java?rev=988089&r1=988088&r2=988089&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/RetrieveComposite.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/RetrieveComposite.java Mon Aug 23 11:47:35 2010
@@ -46,7 +46,7 @@ public class RetrieveComposite extends C
private Text typesText;
- public RetrieveComposite(Composite parent, int style) {
+ public RetrieveComposite(Composite parent, int style, boolean withConf) {
super(parent, style);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
@@ -65,12 +65,14 @@ public class RetrieveComposite extends C
retrieveSyncButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false,
2, 1));
- label = new Label(this, SWT.NONE);
- label.setText("Configurations:");
-
- confsText = new Text(this, SWT.SINGLE | SWT.BORDER);
- confsText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- confsText.setToolTipText(TOOLTIP_RETRIEVE_CONFS);
+ if (withConf) {
+ label = new Label(this, SWT.NONE);
+ label.setText("Configurations:");
+
+ confsText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ confsText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ confsText.setToolTipText(TOOLTIP_RETRIEVE_CONFS);
+ }
label = new Label(this, SWT.NONE);
label.setText("Types:");
@@ -85,7 +87,9 @@ public class RetrieveComposite extends C
RetrieveSetup setup = new RetrieveSetup();
setup.setRetrieveSync(retrieveSyncButton.getSelection());
setup.setRetrievePattern(retrievePatternText.getText());
- setup.setRetrieveConfs(confsText.getText());
+ if (confsText != null) {
+ setup.setRetrieveConfs(confsText.getText());
+ }
setup.setRetrieveTypes(typesText.getText());
return setup;
}
@@ -93,7 +97,9 @@ public class RetrieveComposite extends C
public void init(RetrieveSetup setup) {
retrievePatternText.setText(setup.getRetrievePattern());
retrieveSyncButton.setSelection(setup.isRetrieveSync());
- confsText.setText(setup.getRetrieveConfs());
+ if (confsText != null) {
+ confsText.setText(setup.getRetrieveConfs());
+ }
typesText.setText(setup.getRetrieveTypes());
setEnabled(true);
}
@@ -102,7 +108,9 @@ public class RetrieveComposite extends C
super.setEnabled(enabled);
retrievePatternText.setEnabled(enabled);
retrieveSyncButton.setEnabled(enabled);
- confsText.setEnabled(enabled);
+ if (confsText != null) {
+ confsText.setEnabled(enabled);
+ }
typesText.setEnabled(enabled);
}
}
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/ClasspathPreferencePage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/ClasspathPreferencePage.java?rev=988089&r1=988088&r2=988089&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/ClasspathPreferencePage.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/ClasspathPreferencePage.java Mon Aug 23 11:47:35 2010
@@ -19,6 +19,7 @@ package org.apache.ivyde.eclipse.ui.pref
import org.apache.ivyde.eclipse.IvyPlugin;
import org.apache.ivyde.eclipse.ui.AcceptedSuffixesTypesComposite;
+import org.apache.ivyde.eclipse.ui.ClasspathTypeComposite;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -34,8 +35,7 @@ import org.eclipse.ui.IWorkbenchPreferen
public class ClasspathPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
/** the ID of the preference page */
- public static final String PEREFERENCE_PAGE_ID =
- "org.apache.ivyde.eclipse.ui.preferences.ClasspathPreferencePage";
+ public static final String PEREFERENCE_PAGE_ID = "org.apache.ivyde.eclipse.ui.preferences.ClasspathPreferencePage";
private Button resolveInWorkspaceCheck;
@@ -45,6 +45,8 @@ public class ClasspathPreferencePage ext
private AcceptedSuffixesTypesComposite acceptedSuffixesTypesComposite;
+ private ClasspathTypeComposite classpathTypeComposite;
+
public ClasspathPreferencePage() {
setPreferenceStore(IvyPlugin.getDefault().getPreferenceStore());
}
@@ -87,6 +89,10 @@ public class ClasspathPreferencePage ext
acceptedSuffixesTypesComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
true, false, 3, 1));
+ classpathTypeComposite = new ClasspathTypeComposite(composite, SWT.NONE);
+ classpathTypeComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
+ false, 3, 1));
+
// CheckStyle:MagicNumber| ON
initPreferences();
@@ -100,6 +106,8 @@ public class ClasspathPreferencePage ext
resolveBeforeLaunchCheck.setSelection(helper.isResolveBeforeLaunch());
alphaOrderCheck.select(helper.isAlphOrder() ? 1 : 0);
acceptedSuffixesTypesComposite.init(helper.getContainerMappingSetup());
+ classpathTypeComposite.init(helper.isRetrievedClasspath(), helper
+ .getRetrievedClasspathSetup());
}
public boolean performOk() {
@@ -108,6 +116,8 @@ public class ClasspathPreferencePage ext
helper.setResolveBeforeLaunch(resolveBeforeLaunchCheck.getSelection());
helper.setAlphOrder(alphaOrderCheck.getSelectionIndex() == 1);
helper.setContainerMappingSetup(acceptedSuffixesTypesComposite.getContainerMappingSetup());
+ helper.setRetrievedClasspath(classpathTypeComposite.isRetrievedClasspath());
+ helper.setRetrievedClasspathSetup(classpathTypeComposite.getRetrieveSetup());
return true;
}
@@ -116,5 +126,7 @@ public class ClasspathPreferencePage ext
resolveBeforeLaunchCheck.setSelection(PreferenceInitializer.DEFAULT_RESOLVE_BEFORE_LAUNCH);
alphaOrderCheck.select(PreferenceInitializer.DEFAULT_ALPHABETICAL_ORDER ? 1 : 0);
acceptedSuffixesTypesComposite.init(PreferenceInitializer.DEFAULT_CONTAINER_MAPPING_SETUP);
+ classpathTypeComposite.init(PreferenceInitializer.DEFAULT_RETRIEVED_CLASSPATH,
+ PreferenceInitializer.DEFAULT_RETRIEVED_CLASSPATH_SETUP);
}
}
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/EditStandaloneRetrieveDialog.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/EditStandaloneRetrieveDialog.java?rev=988089&r1=988088&r2=988089&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/EditStandaloneRetrieveDialog.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/EditStandaloneRetrieveDialog.java Mon Aug 23 11:47:35 2010
@@ -97,7 +97,7 @@ public class EditStandaloneRetrieveDialo
ivyFilePathText = new IvyFilePathText(parent, SWT.NONE, project);
ivyFilePathText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- retrieveComposite = new RetrieveComposite(body, SWT.NONE);
+ retrieveComposite = new RetrieveComposite(body, SWT.NONE, true);
retrieveComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
return body;
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=988089&r1=988088&r2=988089&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 Aug 23 11:47:35 2010
@@ -20,6 +20,7 @@ package org.apache.ivyde.eclipse.ui.pref
import org.apache.ivyde.eclipse.cpcontainer.ContainerMappingSetup;
import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
import org.apache.ivyde.eclipse.cpcontainer.IvySettingsSetup;
+import org.apache.ivyde.eclipse.retrieve.RetrieveSetup;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.graphics.RGB;
@@ -184,11 +185,13 @@ public class IvyDEPreferenceStoreHelper
}
public RGB getEditorColorXmlComment() {
- return PreferenceConverter.getColor(prefStore, PreferenceConstants.EDITOR_COLOR_XML_COMMENT);
+ return PreferenceConverter
+ .getColor(prefStore, PreferenceConstants.EDITOR_COLOR_XML_COMMENT);
}
public void setEditorColorXmlComment(RGB color) {
- PreferenceConverter.setValue(prefStore, PreferenceConstants.EDITOR_COLOR_XML_COMMENT, color);
+ PreferenceConverter
+ .setValue(prefStore, PreferenceConstants.EDITOR_COLOR_XML_COMMENT, color);
}
public RGB getEditorColorProcInst() {
@@ -222,4 +225,32 @@ public class IvyDEPreferenceStoreHelper
public void setEditorColorTag(RGB color) {
PreferenceConverter.setValue(prefStore, PreferenceConstants.EDITOR_COLOR_TAG, color);
}
+
+ public boolean isRetrievedClasspath() {
+ return prefStore.getBoolean(PreferenceConstants.RETRIEVED_CLASSPATH);
+ }
+
+ public void setRetrievedClasspath(boolean retrievedClasspath) {
+ prefStore.setValue(PreferenceConstants.RETRIEVED_CLASSPATH, retrievedClasspath);
+ }
+
+ public RetrieveSetup getRetrievedClasspathSetup() {
+ RetrieveSetup retrieveSetup = new RetrieveSetup();
+ retrieveSetup.setRetrievePattern(prefStore
+ .getString(PreferenceConstants.RETRIEVED_CLASSPATH_PATTERN));
+ retrieveSetup.setRetrieveSync(prefStore
+ .getBoolean(PreferenceConstants.RETRIEVED_CLASSPATH_SYNC));
+ retrieveSetup.setRetrieveTypes(prefStore
+ .getString(PreferenceConstants.RETRIEVED_CLASSPATH_TYPES));
+ return retrieveSetup;
+ }
+
+ public void setRetrievedClasspathSetup(RetrieveSetup retrieveSetup) {
+ prefStore.setValue(PreferenceConstants.RETRIEVED_CLASSPATH_PATTERN, retrieveSetup
+ .getRetrievePattern());
+ prefStore.setValue(PreferenceConstants.RETRIEVED_CLASSPATH_SYNC, retrieveSetup
+ .isRetrieveSync());
+ prefStore.setValue(PreferenceConstants.RETRIEVED_CLASSPATH_TYPES, retrieveSetup
+ .getRetrieveTypes());
+ }
}
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=988089&r1=988088&r2=988089&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 Aug 23 11:47:35 2010
@@ -95,4 +95,12 @@ public final class PreferenceConstants {
public static final String EDITOR_COLOR_TAG = "editor.color.tag";
+ public static final String RETRIEVED_CLASSPATH = "retrievedClasspath";
+
+ public static final String RETRIEVED_CLASSPATH_PATTERN = "retrievedClasspath.pattern";
+
+ public static final String RETRIEVED_CLASSPATH_SYNC = "retrievedClasspath.sync";
+
+ public static final String RETRIEVED_CLASSPATH_TYPES = "retrievedClasspath.types";
+
}
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=988089&r1=988088&r2=988089&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 Mon Aug 23 11:47:35 2010
@@ -22,6 +22,7 @@ import org.apache.ivyde.eclipse.IvyPlugi
import org.apache.ivyde.eclipse.cpcontainer.ContainerMappingSetup;
import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
import org.apache.ivyde.eclipse.cpcontainer.IvySettingsSetup;
+import org.apache.ivyde.eclipse.retrieve.RetrieveSetup;
import org.apache.ivyde.eclipse.ui.editors.xml.IXMLColorConstants;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -93,7 +94,24 @@ public class PreferenceInitializer exten
public static final boolean DEFAULT_AUTO_RESOLVE_ON_CHANGE = true;
public static final boolean DEFAULT_IGNORE_VERSION_ON_WORKSPACE_PROJECTS = false;
-
+
+ public static final boolean DEFAULT_RETRIEVED_CLASSPATH = false;
+
+ private static final String DEFAULT_RETRIEVED_CLASSPATH_PATTERN =
+ "lib/[artifact]-[revision].[ext]";
+
+ private static final boolean DEFAULT_RETRIEVED_CLASSPATH_SYNC = false;
+
+ private static final String DEFAULT_RETRIEVED_CLASSPATH_TYPES = "jar";
+
+ public static final RetrieveSetup DEFAULT_RETRIEVED_CLASSPATH_SETUP = new RetrieveSetup();
+
+ static {
+ DEFAULT_RETRIEVED_CLASSPATH_SETUP.setRetrievePattern(DEFAULT_RETRIEVED_CLASSPATH_PATTERN);
+ DEFAULT_RETRIEVED_CLASSPATH_SETUP.setRetrieveSync(DEFAULT_RETRIEVED_CLASSPATH_SYNC);
+ DEFAULT_RETRIEVED_CLASSPATH_SETUP.setRetrieveTypes(DEFAULT_RETRIEVED_CLASSPATH_TYPES);
+ }
+
public void initializeDefaultPreferences() {
IPreferenceStore store = IvyPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_BOOLEAN, true);
@@ -138,6 +156,14 @@ public class PreferenceInitializer exten
IXMLColorConstants.DEFAULT);
PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_COLOR_TAG,
IXMLColorConstants.TAG);
+
+ store.setDefault(PreferenceConstants.RETRIEVED_CLASSPATH, DEFAULT_RETRIEVED_CLASSPATH);
+ store.setDefault(PreferenceConstants.RETRIEVED_CLASSPATH_PATTERN,
+ DEFAULT_RETRIEVED_CLASSPATH_PATTERN);
+ store.setDefault(PreferenceConstants.RETRIEVED_CLASSPATH_SYNC,
+ DEFAULT_RETRIEVED_CLASSPATH_SYNC);
+ store.setDefault(PreferenceConstants.RETRIEVED_CLASSPATH_TYPES,
+ DEFAULT_RETRIEVED_CLASSPATH_TYPES);
}
}