Each code is surrounded in double quotes and a single code and explanation appears on each line.
See the IBM Fault Analyzer IDIHUSRM sample for full details.
Each code appears as a Key, and each explanation as the value.
Each code is specified as a key. Right of the equals, the explanation is specified. Any newlines are provided as '\n'.
See Documentation on Java Properties for full details of the format.
This format is the Java Properies XML format. See Properties documentation for full details.
A Java class can be implemented to be called by the lookup when the Search function is used; they can not provide messages to the USER category node in the Lookup View.
The search string is passed to the user Java Class, it can perform java method calls, such as containing a Web Site or a database, to gather possible code explanations.
For example:
package common.component.lookup.extension.sample; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import common.component.lookup.extension.api.IMessageExplanationProvider; public class SampleMessageProviderImplementation implements IMessageExplanationProvider { @Override public Map<String, String> provideMessagesForId(String searchString, IProgressMonitor monitor) { Map<String, String> messages = new HashMap<>(); if (searchString != null && searchString.equals("SampleMessageProviderImplementation")) { messages.put("SampleMessageProviderImplementation", "This class provides this explanation when the string 'SampleMessageProviderImplementation' is searched for."); } return messages; } }
The following example shows how each type of user code explanation extension can be specified in plugin.xml files:
<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="pdtools.user.code.explanation.providers"> <dynamicProvider class="common.component.lookup.extension.sample.SampleMessageProviderImplementation" category="OTHERS" /> <staticProvider file="sample.mappings.properties" category="OTHERS" type="PROPERTIES" /> <staticProvider file="sample.mappings.xml" category="OTHERS" type="PROPERTIES_XML" /> <staticProvider file="sample.mappings.json" category="OTHERS" type="JSON" /> <staticProvider file="sample.mappings.csv" category="OTHERS" type="CSV" /> <IDIHUSRMProvider file="sample.mappings.idihusrm" /> </extension> </plugin>