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 2008/11/11 21:48:48 UTC
svn commit: r713159 - in
/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse:
./ cpcontainer/ ui/
Author: hibou
Date: Tue Nov 11 12:48:47 2008
New Revision: 713159
URL: http://svn.apache.org/viewvc?rev=713159&view=rev
Log:
IVYDE-119:
- one more widget extracted
- refactoring of the configuration panel
- now there are three "project specific configurations"
Added:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java (with props)
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.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
Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java?rev=713159&r1=713158&r2=713159&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java Tue Nov 11 12:48:47 2008
@@ -142,7 +142,7 @@
IJavaProject[] projects = plugin.javaModel.getJavaProjects();
for (int i = 0; i < projects.length; i++) {
IvyClasspathContainer cp = IvyClasspathUtil.getIvyClasspathContainer(projects[i]);
- if (cp != null && !cp.getConf().isProjectSpecific()) {
+ if (cp != null && !cp.getConf().isSettingsProjectSpecific()) {
cp.launchResolve(false, false, 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=713159&r1=713158&r2=713159&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 Tue Nov 11 12:48:47 2008
@@ -101,6 +101,10 @@
private final boolean editing;
+ boolean isAdvancedProjectSpecific;
+
+ boolean isRetrieveProjectSpecific;
+
/**
* Constructor
*
@@ -169,7 +173,8 @@
private void loadV1(IPath path) {
String url = path.segment(1).substring(1);
String[] parameters = url.split("&");
- boolean isProjectSpecific = false;
+ isAdvancedProjectSpecific = false;
+ isRetrieveProjectSpecific = false;
for (int i = 0; i < parameters.length; i++) {
String[] parameter = parameters[i].split("=");
if (parameter == null || parameter.length == 0) {
@@ -189,47 +194,51 @@
confs = IvyClasspathUtil.split(value);
} else if (parameter[0].equals("ivySettingsPath")) {
ivySettingsPath = readOldIvySettings(value);
- isProjectSpecific = true;
+ } else if (parameter[0].equals("doRetrieve")) {
+ // if the value is not actually "true" or "false", the Boolean class ensure to
+ // return false, so it is fine
+ doRetrieve = Boolean.valueOf(value).booleanValue();
+ isRetrieveProjectSpecific = true;
+ } else if (parameter[0].equals("retrievePattern")) {
+ retrievePattern = value;
+ isRetrieveProjectSpecific = true;
+ } else if (parameter[0].equals("retrieveSync")) {
+ retrieveSync = Boolean.valueOf(value).booleanValue();
+ isRetrieveProjectSpecific = true;
} else if (parameter[0].equals("acceptedTypes")) {
acceptedTypes = IvyClasspathUtil.split(value);
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("sourceTypes")) {
sourceTypes = IvyClasspathUtil.split(value);
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("javadocTypes")) {
javadocTypes = IvyClasspathUtil.split(value);
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("sourceSuffixes")) {
sourceSuffixes = IvyClasspathUtil.split(value);
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("javadocSuffixes")) {
javadocSuffixes = IvyClasspathUtil.split(value);
- isProjectSpecific = true;
- } else if (parameter[0].equals("doRetrieve")) {
- // if the value is not actually "true" or "false", the Boolean class ensure to
- // return false, so it is fine
- doRetrieve = Boolean.valueOf(value).booleanValue();
- isProjectSpecific = true;
- } else if (parameter[0].equals("retrievePattern")) {
- retrievePattern = value;
- isProjectSpecific = true;
- } else if (parameter[0].equals("retrieveSync")) {
- retrieveSync = Boolean.valueOf(value).booleanValue();
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("alphaOrder")) {
// if the value is not actually "true" or "false", the Boolean class ensure to
// return false, so it is fine
alphaOrder = Boolean.valueOf(value).booleanValue();
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
} else if (parameter[0].equals("resolveInWorkspace")) {
resolveInWorkspace = Boolean.valueOf(value).booleanValue();
- isProjectSpecific = true;
+ isAdvancedProjectSpecific = true;
}
}
- if (isProjectSpecific) {
+ if (isAdvancedProjectSpecific) {
// in this V1 version, it is just some paranoid check
checkNonNullConf();
}
+ if (isRetrieveProjectSpecific) {
+ if (retrievePattern == null) {
+ retrievePattern = IvyPlugin.getPreferenceStoreHelper().getRetrievePattern();
+ }
+ }
}
/**
@@ -260,9 +269,6 @@
}
private void checkNonNullConf() {
- if (ivySettingsPath == null) {
- ivySettingsPath = IvyPlugin.getPreferenceStoreHelper().getIvySettingsPath();
- }
if (acceptedTypes == null) {
acceptedTypes = IvyPlugin.getPreferenceStoreHelper().getAcceptedTypes();
}
@@ -278,9 +284,6 @@
if (javadocSuffixes == null) {
javadocSuffixes = IvyPlugin.getPreferenceStoreHelper().getJavadocSuffixes();
}
- if (retrievePattern == null) {
- retrievePattern = IvyPlugin.getPreferenceStoreHelper().getRetrievePattern();
- }
}
public IPath getPath() {
@@ -294,6 +297,16 @@
if (ivySettingsPath != null) {
path.append("&ivySettingsPath=");
path.append(URLEncoder.encode(ivySettingsPath, "UTF-8"));
+ }
+ if (isRetrieveProjectSpecific) {
+ path.append("&doRetrieve=");
+ path.append(URLEncoder.encode(Boolean.toString(doRetrieve), "UTF-8"));
+ path.append("&retrievePattern=");
+ path.append(URLEncoder.encode(retrievePattern, "UTF-8"));
+ path.append("&retrieveSync=");
+ path.append(URLEncoder.encode(Boolean.toString(retrieveSync), "UTF-8"));
+ }
+ if (isAdvancedProjectSpecific) {
path.append("&acceptedTypes=");
path.append(URLEncoder.encode(IvyClasspathUtil.concat(acceptedTypes), "UTF-8"));
path.append("&sourceTypes=");
@@ -304,12 +317,6 @@
path.append(URLEncoder.encode(IvyClasspathUtil.concat(sourceSuffixes), "UTF-8"));
path.append("&javadocSuffixes=");
path.append(URLEncoder.encode(IvyClasspathUtil.concat(javadocSuffixes), "UTF-8"));
- path.append("&doRetrieve=");
- path.append(URLEncoder.encode(Boolean.toString(doRetrieve), "UTF-8"));
- path.append("&retrievePattern=");
- path.append(URLEncoder.encode(retrievePattern, "UTF-8"));
- path.append("&retrieveSync=");
- path.append(URLEncoder.encode(Boolean.toString(retrieveSync), "UTF-8"));
path.append("&alphaOrder=");
path.append(URLEncoder.encode(Boolean.toString(alphaOrder), "UTF-8"));
path.append("&resolveInWorkspace=");
@@ -541,84 +548,92 @@
return ivySettingsPath;
}
+ public boolean getInheritedDoRetrieve() {
+ if (javaProject == null) {
+ // no project means no retrieve possible
+ return false;
+ }
+ if (!isRetrieveProjectSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().getDoRetrieve();
+ }
+ return doRetrieve;
+ }
+
+ public String getInheritedRetrievePattern() {
+ if (!isRetrieveProjectSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().getRetrievePattern();
+ }
+ return retrievePattern;
+ }
+
+ public boolean getInheritedRetrieveSync() {
+ if (!isRetrieveProjectSpecific) {
+ return IvyPlugin.getPreferenceStoreHelper().getRetrieveSync();
+ }
+ return retrieveSync;
+ }
+
public Collection getInheritedAcceptedTypes() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().getAcceptedTypes();
}
return acceptedTypes;
}
public Collection getInheritedSourceTypes() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().getSourceTypes();
}
return sourceTypes;
}
public Collection getInheritedSourceSuffixes() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().getSourceSuffixes();
}
return sourceSuffixes;
}
public Collection getInheritedJavadocTypes() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().getJavadocTypes();
}
return javadocTypes;
}
public Collection getInheritedJavadocSuffixes() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().getJavadocSuffixes();
}
return javadocSuffixes;
}
- public boolean getInheritedDoRetrieve() {
- if (javaProject == null) {
- // no project means no retrieve possible
- return false;
- }
- if (ivySettingsPath == null) {
- return IvyPlugin.getPreferenceStoreHelper().getDoRetrieve();
- }
- return doRetrieve;
- }
-
- public String getInheritedRetrievePattern() {
- if (ivySettingsPath == null) {
- return IvyPlugin.getPreferenceStoreHelper().getRetrievePattern();
- }
- return retrievePattern;
- }
-
- public boolean getInheritedRetrieveSync() {
- if (ivySettingsPath == null) {
- return IvyPlugin.getPreferenceStoreHelper().getRetrieveSync();
- }
- return retrieveSync;
- }
-
public boolean isInheritedAlphaOrder() {
- if (ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().isAlphOrder();
}
return alphaOrder;
}
public boolean isResolveInWorkspace() {
- if (this.ivySettingsPath == null) {
+ if (!isAdvancedProjectSpecific) {
return IvyPlugin.getPreferenceStoreHelper().isResolveInWorkspace();
}
return resolveInWorkspace;
}
- public boolean isProjectSpecific() {
+ public boolean isSettingsProjectSpecific() {
return ivySettingsPath != null;
}
+ public boolean isAdvancedProjectSpecific() {
+ return isAdvancedProjectSpecific;
+ }
+
+ public boolean isRetrieveProjectSpecific() {
+ return isRetrieveProjectSpecific;
+ }
+
public File getIvyFile() {
File file;
if (javaProject != null) {
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=713159&r1=713158&r2=713159&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 Tue Nov 11 12:48:47 2008
@@ -20,6 +20,7 @@
import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
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.ConfTableViewer;
import org.apache.ivyde.eclipse.ui.IvyFilePathText;
import org.apache.ivyde.eclipse.ui.RetrieveComposite;
@@ -49,7 +50,6 @@
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PreferencesUtil;
public class IvydeContainerPage extends NewElementWizardPage implements IClasspathContainerPage,
@@ -63,38 +63,32 @@
private SettingsPathText settingsText;
- private Text acceptedTypesText;
-
- private Text sourcesTypesText;
-
- private Text sourcesSuffixesText;
-
- private Text javadocTypesText;
-
- private Text javadocSuffixesText;
-
private Combo alphaOrderCheck;
private Button resolveInWorkspaceCheck;
- private Button projectSpecificButton;
+ private Button settingsProjectSpecificButton;
+
+ private Button advancedProjectSpecificButton;
- private Link generalSettingsLink;
+ private Link mainGeneralSettingsLink;
- private Composite configComposite;
+ private Link advancedGeneralSettingsLink;
private IvyClasspathContainerConfiguration conf;
private IClasspathEntry entry;
- private TabItem mainTab;
-
private TabFolder tabs;
- private TabItem advancedTab;
-
private RetrieveComposite retrieveComposite;
+ private AcceptedSuffixesTypesComposite acceptedSuffixesTypesComposite;
+
+ private Button retrieveProjectSpecificButton;
+
+ private Link retrieveGeneralSettingsLink;
+
/**
* Constructor
*/
@@ -128,13 +122,13 @@
public boolean finish() {
conf.confs = confTableViewer.getSelectedConfigurations();
- if (projectSpecificButton.getSelection()) {
+ if (settingsProjectSpecificButton.getSelection()) {
conf.ivySettingsPath = settingsText.getSettingsPath();
- conf.acceptedTypes = IvyClasspathUtil.split(acceptedTypesText.getText());
- conf.sourceTypes = IvyClasspathUtil.split(sourcesTypesText.getText());
- conf.javadocTypes = IvyClasspathUtil.split(javadocTypesText.getText());
- conf.sourceSuffixes = IvyClasspathUtil.split(sourcesSuffixesText.getText());
- conf.javadocSuffixes = IvyClasspathUtil.split(javadocSuffixesText.getText());
+ conf.acceptedTypes = acceptedSuffixesTypesComposite.getAcceptedTypes();
+ conf.sourceTypes = acceptedSuffixesTypesComposite.getSourcesTypes();
+ conf.javadocTypes = acceptedSuffixesTypesComposite.getJavadocTypes();
+ conf.sourceSuffixes = acceptedSuffixesTypesComposite.getSourceSuffixes();
+ conf.javadocSuffixes = acceptedSuffixesTypesComposite.getJavadocSuffixes();
conf.doRetrieve = retrieveComposite.isRetrieveEnabled();
conf.retrievePattern = retrieveComposite.getRetrievePattern();
conf.retrieveSync = retrieveComposite.isSyncEnabled();
@@ -143,6 +137,26 @@
} else {
conf.ivySettingsPath = null;
}
+ if (retrieveProjectSpecificButton.getSelection()) {
+ conf.isRetrieveProjectSpecific = true;
+ conf.doRetrieve = retrieveComposite.isRetrieveEnabled();
+ conf.retrievePattern = retrieveComposite.getRetrievePattern();
+ conf.retrieveSync = retrieveComposite.isSyncEnabled();
+ } else {
+ conf.isRetrieveProjectSpecific = false;
+ }
+ if (advancedProjectSpecificButton.getSelection()) {
+ conf.isAdvancedProjectSpecific = true;
+ conf.acceptedTypes = acceptedSuffixesTypesComposite.getAcceptedTypes();
+ conf.sourceTypes = acceptedSuffixesTypesComposite.getSourcesTypes();
+ conf.javadocTypes = acceptedSuffixesTypesComposite.getJavadocTypes();
+ conf.sourceSuffixes = acceptedSuffixesTypesComposite.getSourceSuffixes();
+ conf.javadocSuffixes = acceptedSuffixesTypesComposite.getJavadocSuffixes();
+ conf.alphaOrder = alphaOrderCheck.getSelectionIndex() == 1;
+ conf.resolveInWorkspace = resolveInWorkspaceCheck.getSelection();
+ } else {
+ conf.isAdvancedProjectSpecific = false;
+ }
entry = JavaCore.newContainerEntry(conf.getPath());
return true;
}
@@ -166,10 +180,18 @@
tabs = new TabFolder(parent, SWT.BORDER);
tabs.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- mainTab = new TabItem(tabs, SWT.NONE);
+ TabItem mainTab = new TabItem(tabs, SWT.NONE);
mainTab.setText("Main");
mainTab.setControl(createMainTab(tabs));
+ TabItem retrieveTab = new TabItem(tabs, SWT.NONE);
+ retrieveTab.setText("Retrieve");
+ retrieveTab.setControl(createRetrieveTab(tabs));
+
+ TabItem advancedTab = new TabItem(tabs, SWT.NONE);
+ advancedTab.setText("Advanced");
+ advancedTab.setControl(createAdvancedTab(tabs));
+
tabs.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ivyFilePathText.updateErrorMarker();
@@ -177,10 +199,6 @@
}
});
- advancedTab = new TabItem(tabs, SWT.NONE);
- advancedTab.setText("Advanced");
- advancedTab.setControl(createAdvancedTab(tabs));
-
setControl(tabs);
loadFromConf();
@@ -190,14 +208,62 @@
private Control createMainTab(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(3, false));
+ composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+ Composite headerComposite = new Composite(composite, SWT.NONE);
+ headerComposite.setLayout(new GridLayout(2, false));
+ headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+ settingsProjectSpecificButton = new Button(headerComposite, SWT.CHECK);
+ settingsProjectSpecificButton.setText("Enable project specific settings");
+ settingsProjectSpecificButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateFieldsStatusSettings();
+ conf.ivySettingsPath = settingsText.getSettingsPath();
+ settingsUpdated();
+ }
+ });
+
+ mainGeneralSettingsLink = new Link(headerComposite, SWT.NONE);
+ mainGeneralSettingsLink.setFont(headerComposite.getFont());
+ mainGeneralSettingsLink.setText("<A>Configure Workspace Settings...</A>");
+ mainGeneralSettingsLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
+ IvyPreferencePage.PEREFERENCE_PAGE_ID, null, null);
+ dialog.open();
+ }
+ });
+ mainGeneralSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
+
+ Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
+ horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+
+ Composite configComposite = new Composite(composite, SWT.NONE);
+ configComposite.setLayout(new GridLayout(3, false));
+ configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+ Label label = new Label(configComposite, SWT.NONE);
+ label.setText("Ivy settings path:");
+
+ settingsText = new SettingsPathText(configComposite, SWT.NONE);
+ settingsText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+ settingsText.addListener(new SettingsPathListener() {
+ public void settingsPathUpdated(String path) {
+ conf.ivySettingsPath = path;
+ settingsUpdated();
+ }
+ });
+
+ horizontalLine = new Label(configComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
+ horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
+
// Label for ivy file field
- Label pathLabel = new Label(composite, SWT.NONE);
+ Label pathLabel = new Label(configComposite, SWT.NONE);
pathLabel.setText("Ivy File");
- ivyFilePathText = new IvyFilePathText(composite, SWT.NONE, project);
+ ivyFilePathText = new IvyFilePathText(configComposite, SWT.NONE, project);
ivyFilePathText.addListener(new IvyXmlPathListener() {
public void ivyXmlPathUpdated(String path) {
conf.ivyXmlPath = path;
@@ -208,15 +274,15 @@
.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
// Label for ivy configurations field
- Label confLabel = new Label(composite, SWT.NONE);
+ Label confLabel = new Label(configComposite, SWT.NONE);
confLabel.setText("Configurations");
// table for configuration selection
- confTableViewer = new ConfTableViewer(composite, SWT.NONE);
+ confTableViewer = new ConfTableViewer(configComposite, SWT.NONE);
confTableViewer.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
// refresh
- Button refreshConf = new Button(composite, SWT.NONE);
+ Button refreshConf = new Button(configComposite, SWT.NONE);
refreshConf.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
refreshConf.setText("Refresh");
refreshConf.addSelectionListener(new SelectionAdapter() {
@@ -236,7 +302,7 @@
return composite;
}
- private Control createAdvancedTab(Composite parent) {
+ private Control createRetrieveTab(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
@@ -245,101 +311,83 @@
headerComposite.setLayout(new GridLayout(2, false));
headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- projectSpecificButton = new Button(headerComposite, SWT.CHECK);
- projectSpecificButton.setText("Enable project specific settings");
- projectSpecificButton.addSelectionListener(new SelectionAdapter() {
+ retrieveProjectSpecificButton = new Button(headerComposite, SWT.CHECK);
+ retrieveProjectSpecificButton.setText("Enable project specific settings");
+ retrieveProjectSpecificButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- updateFieldsStatus();
- conf.ivySettingsPath = settingsText.getSettingsPath();
- settingsUpdated();
+ updateFieldsStatusRetrieve();
}
});
- generalSettingsLink = new Link(headerComposite, SWT.NONE);
- generalSettingsLink.setFont(composite.getFont());
- generalSettingsLink.setText("<A>Configure Workspace Settings...</A>");
- generalSettingsLink.addSelectionListener(new SelectionAdapter() {
+ retrieveGeneralSettingsLink = new Link(headerComposite, SWT.NONE);
+ retrieveGeneralSettingsLink.setFont(composite.getFont());
+ retrieveGeneralSettingsLink.setText("<A>Configure Workspace Settings...</A>");
+ retrieveGeneralSettingsLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
IvyPreferencePage.PEREFERENCE_PAGE_ID, null, null);
dialog.open();
}
});
- generalSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
+ retrieveGeneralSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- configComposite = new Composite(composite, SWT.NONE);
- configComposite.setLayout(new GridLayout(3, false));
+ Composite configComposite = new Composite(composite, SWT.NONE);
+ configComposite.setLayout(new GridLayout());
configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- Label label = new Label(configComposite, SWT.NONE);
- label.setText("Ivy settings path:");
+ retrieveComposite = new RetrieveComposite(configComposite, SWT.NONE);
+ retrieveComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- settingsText = new SettingsPathText(configComposite, SWT.NONE);
- settingsText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- settingsText.addListener(new SettingsPathListener() {
- public void settingsPathUpdated(String path) {
- conf.ivySettingsPath = path;
- settingsUpdated();
+ return composite;
+ }
+
+ private Control createAdvancedTab(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+ Composite headerComposite = new Composite(composite, SWT.NONE);
+ headerComposite.setLayout(new GridLayout(2, false));
+ headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+ advancedProjectSpecificButton = new Button(headerComposite, SWT.CHECK);
+ advancedProjectSpecificButton.setText("Enable project specific settings");
+ advancedProjectSpecificButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateFieldsStatusAdvanced();
}
});
- label = new Label(configComposite, SWT.NONE);
- label.setText("Accepted types:");
-
- acceptedTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
- acceptedTypesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2,
- 1));
- acceptedTypesText.setToolTipText("Comma separated list of artifact types"
- + " to use in IvyDE Managed Dependencies Library.\n" + "Example: jar, zip");
-
- label = new Label(configComposite, SWT.NONE);
- label.setText("Sources types:");
-
- sourcesTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
- sourcesTypesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false,
- 2, 1));
- sourcesTypesText
- .setToolTipText("Comma separated list of artifact types to be used as sources.\n"
- + "Example: source, src");
-
- label = new Label(configComposite, SWT.NONE);
- label.setText("Sources suffixes:");
-
- sourcesSuffixesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
- sourcesSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
- 2, 1));
- sourcesSuffixesText
- .setToolTipText("Comma separated list of suffixes to match sources to artifacts.\n"
- + "Example: -source, -src");
+ advancedGeneralSettingsLink = new Link(headerComposite, SWT.NONE);
+ advancedGeneralSettingsLink.setFont(composite.getFont());
+ advancedGeneralSettingsLink.setText("<A>Configure Workspace Settings...</A>");
+ advancedGeneralSettingsLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
+ IvyPreferencePage.PEREFERENCE_PAGE_ID, null, null);
+ dialog.open();
+ }
+ });
+ advancedGeneralSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
- label = new Label(configComposite, SWT.NONE);
- label.setText("Javadoc types:");
+ Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
+ horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- javadocTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
- javadocTypesText
- .setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- javadocTypesText
- .setToolTipText("Comma separated list of artifact types to be used as javadoc.\n"
- + "Example: javadoc.");
-
- label = new Label(configComposite, SWT.NONE);
- label.setText("Javadoc suffixes:");
-
- javadocSuffixesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
- javadocSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
- 2, 1));
- javadocSuffixesText
- .setToolTipText("Comma separated list of suffixes to match javadocs to artifacts.\n"
- + "Example: -javadoc, -doc");
+ Composite configComposite = new Composite(composite, SWT.NONE);
+ configComposite.setLayout(new GridLayout(3, false));
+ configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- retrieveComposite = new RetrieveComposite(configComposite, SWT.NONE);
- retrieveComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 3,
- 1));
+ resolveInWorkspaceCheck = new Button(configComposite, SWT.CHECK);
+ resolveInWorkspaceCheck.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
+ false, 3, 1));
+ resolveInWorkspaceCheck.setText("Resolve dependencies in workspace (EXPERIMENTAL)");
+ resolveInWorkspaceCheck
+ .setToolTipText("Will replace jars on the classpath with workspace projects");
- label = new Label(configComposite, SWT.NONE);
+ Label label = new Label(configComposite, SWT.NONE);
label.setText("Order of the classpath entries:");
alphaOrderCheck = new Combo(configComposite, SWT.READ_ONLY);
@@ -349,12 +397,10 @@
alphaOrderCheck.add("From the ivy.xml");
alphaOrderCheck.add("Lexical");
- resolveInWorkspaceCheck = new Button(this.configComposite, SWT.CHECK);
- resolveInWorkspaceCheck.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
- false, 2, 1));
- resolveInWorkspaceCheck.setText("Resolve dependencies in workspace");
- resolveInWorkspaceCheck
- .setToolTipText("Will replace jars on the classpath with workspace projects");
+ acceptedSuffixesTypesComposite = new AcceptedSuffixesTypesComposite(configComposite,
+ SWT.NONE);
+ acceptedSuffixesTypesComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
+ true, false, 3, 1));
return composite;
}
@@ -374,46 +420,59 @@
ivyFilePathText.init(conf.ivyXmlPath);
confTableViewer.init(conf.confs);
- if (conf.isProjectSpecific()) {
- projectSpecificButton.setSelection(true);
+ IvyDEPreferenceStoreHelper helper = IvyPlugin.getPreferenceStoreHelper();
+
+ if (conf.isSettingsProjectSpecific()) {
+ settingsProjectSpecificButton.setSelection(true);
settingsText.init(conf.ivySettingsPath);
- acceptedTypesText.setText(IvyClasspathUtil.concat(conf.acceptedTypes));
- sourcesTypesText.setText(IvyClasspathUtil.concat(conf.sourceTypes));
- sourcesSuffixesText.setText(IvyClasspathUtil.concat(conf.sourceSuffixes));
- javadocTypesText.setText(IvyClasspathUtil.concat(conf.javadocTypes));
- javadocSuffixesText.setText(IvyClasspathUtil.concat(conf.javadocSuffixes));
+ } else {
+ settingsProjectSpecificButton.setSelection(false);
+ settingsText.init(helper.getIvySettingsPath());
+ }
+
+ if (conf.isRetrieveProjectSpecific()) {
+ retrieveProjectSpecificButton.setSelection(true);
retrieveComposite.init(conf.doRetrieve, conf.retrievePattern, conf.retrieveSync);
+ } else {
+ retrieveProjectSpecificButton.setSelection(false);
+ retrieveComposite.init(helper.getDoRetrieve(), helper.getRetrievePattern(), helper
+ .getRetrieveSync());
+ }
+
+ if (conf.isAdvancedProjectSpecific()) {
+ advancedProjectSpecificButton.setSelection(true);
+ acceptedSuffixesTypesComposite.init(conf.acceptedTypes, conf.sourceTypes,
+ conf.sourceSuffixes, conf.javadocTypes, conf.javadocSuffixes);
alphaOrderCheck.select(conf.alphaOrder ? 1 : 0);
resolveInWorkspaceCheck.setSelection(this.conf.resolveInWorkspace);
} else {
- projectSpecificButton.setSelection(false);
- IvyDEPreferenceStoreHelper helper = IvyPlugin.getPreferenceStoreHelper();
- settingsText.init(helper.getIvySettingsPath());
- acceptedTypesText.setText(IvyClasspathUtil.concat(helper.getAcceptedTypes()));
- sourcesTypesText.setText(IvyClasspathUtil.concat(helper.getSourceTypes()));
- sourcesSuffixesText.setText(IvyClasspathUtil.concat(helper.getSourceSuffixes()));
- javadocTypesText.setText(IvyClasspathUtil.concat(helper.getJavadocTypes()));
- javadocSuffixesText.setText(IvyClasspathUtil.concat(helper.getJavadocSuffixes()));
- retrieveComposite.init(helper.getDoRetrieve(), helper.getRetrievePattern(), helper.getRetrieveSync());
+ advancedProjectSpecificButton.setSelection(false);
+ acceptedSuffixesTypesComposite.init(helper.getAcceptedTypes(), helper.getSourceTypes(),
+ helper.getSourceSuffixes(), helper.getJavadocTypes(), helper.getJavadocSuffixes());
alphaOrderCheck.select(helper.isAlphOrder() ? 1 : 0);
resolveInWorkspaceCheck.setSelection(helper.isResolveInWorkspace());
}
- updateFieldsStatus();
+ updateFieldsStatusSettings();
+ updateFieldsStatusRetrieve();
+ updateFieldsStatusAdvanced();
}
- void updateFieldsStatus() {
- boolean projectSpecific = projectSpecificButton.getSelection();
- generalSettingsLink.setEnabled(!projectSpecific);
- configComposite.setEnabled(projectSpecific);
+ void updateFieldsStatusSettings() {
+ boolean projectSpecific = settingsProjectSpecificButton.getSelection();
+ mainGeneralSettingsLink.setEnabled(!projectSpecific);
settingsText.setEnabled(projectSpecific);
- acceptedTypesText.setEnabled(projectSpecific);
- sourcesTypesText.setEnabled(projectSpecific);
- sourcesSuffixesText.setEnabled(projectSpecific);
- javadocTypesText.setEnabled(projectSpecific);
- javadocSuffixesText.setEnabled(projectSpecific);
- retrieveComposite.setEnabled(projectSpecific);
+ }
+
+ void updateFieldsStatusRetrieve() {
+ boolean projectSpecific = retrieveProjectSpecificButton.getSelection();
retrieveComposite.setEnabled(projectSpecific);
+ }
+
+ void updateFieldsStatusAdvanced() {
+ boolean projectSpecific = advancedProjectSpecificButton.getSelection();
+ advancedGeneralSettingsLink.setEnabled(!projectSpecific);
+ acceptedSuffixesTypesComposite.setEnabled(projectSpecific);
alphaOrderCheck.setEnabled(projectSpecific);
resolveInWorkspaceCheck.setEnabled(projectSpecific);
}
Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java?rev=713159&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java Tue Nov 11 12:48:47 2008
@@ -0,0 +1,133 @@
+/*
+ * 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 java.util.Collection;
+import java.util.List;
+
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class AcceptedSuffixesTypesComposite extends Composite {
+
+ private Text acceptedTypesText;
+
+ private Text sourcesTypesText;
+
+ private Text sourcesSuffixesText;
+
+ private Text javadocTypesText;
+
+ private Text javadocSuffixesText;
+
+ public AcceptedSuffixesTypesComposite(Composite parent, int style) {
+ super(parent, style);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ setLayout(layout);
+
+ Label label = new Label(this, SWT.NONE);
+ label.setText("Accepted types:");
+
+ acceptedTypesText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ acceptedTypesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ acceptedTypesText.setToolTipText("Comma separated list of artifact types"
+ + " to use in IvyDE Managed Dependencies Library.\n" + "Example: jar, zip");
+
+ label = new Label(this, SWT.NONE);
+ label.setText("Sources types:");
+
+ sourcesTypesText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ sourcesTypesText
+ .setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
+ sourcesTypesText
+ .setToolTipText("Comma separated list of artifact types to be used as sources.\n"
+ + "Example: source, src");
+
+ label = new Label(this, SWT.NONE);
+ label.setText("Sources suffixes:");
+
+ sourcesSuffixesText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ sourcesSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ sourcesSuffixesText
+ .setToolTipText("Comma separated list of suffixes to match sources to artifacts.\n"
+ + "Example: -source, -src");
+
+ label = new Label(this, SWT.NONE);
+ label.setText("Javadoc types:");
+
+ javadocTypesText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ javadocTypesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ javadocTypesText
+ .setToolTipText("Comma separated list of artifact types to be used as javadoc.\n"
+ + "Example: javadoc.");
+
+ label = new Label(this, SWT.NONE);
+ label.setText("Javadoc suffixes:");
+
+ javadocSuffixesText = new Text(this, SWT.SINGLE | SWT.BORDER);
+ javadocSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+ javadocSuffixesText
+ .setToolTipText("Comma separated list of suffixes to match javadocs to artifacts.\n"
+ + "Example: -javadoc, -doc");
+ }
+
+ public void init(Collection acceptedTypes, Collection sourceTypes, Collection sourceSuffixes,
+ Collection javadocTypes, Collection javadocSuffixes) {
+ acceptedTypesText.setText(IvyClasspathUtil.concat(acceptedTypes));
+ sourcesTypesText.setText(IvyClasspathUtil.concat(sourceTypes));
+ sourcesSuffixesText.setText(IvyClasspathUtil.concat(sourceSuffixes));
+ javadocTypesText.setText(IvyClasspathUtil.concat(javadocTypes));
+ javadocSuffixesText.setText(IvyClasspathUtil.concat(javadocSuffixes));
+ }
+
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ acceptedTypesText.setEnabled(enabled);
+ sourcesTypesText.setEnabled(enabled);
+ sourcesSuffixesText.setEnabled(enabled);
+ javadocTypesText.setEnabled(enabled);
+ javadocSuffixesText.setEnabled(enabled);
+ }
+
+ public List getAcceptedTypes() {
+ return IvyClasspathUtil.split(acceptedTypesText.getText());
+ }
+
+ public List getSourcesTypes() {
+ return IvyClasspathUtil.split(sourcesTypesText.getText());
+ }
+
+ public List getJavadocTypes() {
+ return IvyClasspathUtil.split(javadocTypesText.getText());
+ }
+
+ public List getSourceSuffixes() {
+ return IvyClasspathUtil.split(sourcesSuffixesText.getText());
+ }
+
+ public List getJavadocSuffixes() {
+ return IvyClasspathUtil.split(javadocSuffixesText.getText());
+ }
+}
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/AcceptedSuffixesTypesComposite.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=713159&r1=713158&r2=713159&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 Tue Nov 11 12:48:47 2008
@@ -92,7 +92,7 @@
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
doRetrieveButton.setEnabled(enabled);
- retrievePatternText.setEnabled(enabled);
- retrieveSyncButton.setEnabled(enabled);
+ retrievePatternText.setEnabled(enabled && doRetrieveButton.getSelection());
+ retrieveSyncButton.setEnabled(enabled && doRetrieveButton.getSelection());
}
}