Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Comparing launch configurations

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.

Comparators are contributed using the org.eclipse.debug.core.launchConfigurationComparators extension point. 

The Java tools supply launch configuration comparators for comparing program source paths and class paths.

<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>

Comparators must implement the interface java.util.Comparator.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire