How do you use getSample() when Building a Plugin

Hi,

I have built a plugin and I need to provide a certain amount of information to the users. So, I wanted add a description to it. I have already set the getParameterNames() and getToolTip() functions.

I assume you can use the function,

public String getSample(String arg0)
 {
         return null;
}

Can someone please give me an example?

Regards,
Hareendra

Hi Hareendra,

This is what I use (based on Patrick’s excellent plugin tutorial):

	@Override
	public String getSample(String methodName) {
		StringBuffer buffer = new StringBuffer();
		if ("topic1".equals(methodName)) {
			buffer.append("topic1 - line1 \n");
		}else if ("topic2".equals(methodName)) {
			buffer.append("topic2 - line1 \n");
			buffer.append("topic2 - line2 \n");
		}else if ("topic3".equals(methodName)) {
			buffer.append("topic3 - line1 \n");
		}
		return buffer.toString();
	}

Thanks a lot Omar! Now my plugin is complete :lol: