| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE>Comparing launch configurations</TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| |
| <h4>Comparing launch configurations</h4> |
| <p>We've seen how a plug-in can use named attributes and values to store important data with a |
| launch configuration. Since the interpretation of a plug-in's attributes are not known by the platform, |
| an extension point is provided that allows you to supply a comparator for a specific attribute. |
| This comparator is used to determine whether attributes of the specified name are |
| equal. In many cases, the simple string compare provided by |
| java.lang.Object.equals(Object) is suitable for comparing attributes. This |
| technique will be used if no comparator has been provided. However, some attribute values |
| may require special handling, such as stripping white space values from text |
| before comparing for equality. </p> |
| <p>Comparators are contributed using the <a href="../reference/extension-points/org_eclipse_debug_core_launchConfigurationComparators.html"><b>org.eclipse.debug.core.launchConfigurationComparators</b></a> |
| extension point. </p> |
| <p>The Java tools supply launch configuration comparators for comparing program |
| source paths and class paths.</p> |
| <pre><extension point = "org.eclipse.debug.core.launchConfigurationComparators"> |
| <launchConfigurationComparator |
| id = "org.eclipse.jdt.launching.classpathComparator" |
| class = "org.eclipse.jdt.internal.launching.RuntimeClasspathEntryListComparator" |
| attribute = "org.eclipse.jdt.launching.CLASSPATH"/> |
| <launchConfigurationComparator |
| id = "org.eclipse.jdt.launching.sourcepathComparator" |
| class = "org.eclipse.jdt.internal.launching.RuntimeClasspathEntryListComparator" |
| attribute = "org.eclipse.jdt.launching.SOURCE_PATH"/> |
| </extension></pre> |
| <p>Comparators must implement the interface <b>java.util.Comparator</b>.</p> |
| </BODY> |
| </HTML> |