This documentation relates to QuickBuild 14.0.x
Select here if you are using a different version

Write Custom Gadget

In this example, we will enhance the plugin in tutorial Write Your First Plugin to add a custom gadget to display a specified message. Firstable, we create our gadget class as below:

package com.example.myplugin;

import org.apache.wicket.Component;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.basic.Label;
import org.hibernate.validator.constraints.NotEmpty;

import com.pmease.quickbuild.annotation.Editable;

@Editable(name="My Message", order=100001, category=GadgetCategory.OTHERS)
public class MyMessageGadget extends Gadget {

	private static final long serialVersionUID = 1L;
	private String message;

	@Editable(name="Message", description="Specify a message to display.")
	public String getMessage() {
		return message;

	public String getCssClass() {
		return "window";

	public void setMessage(String message) {
		this.message = message;

	public Component renderBody(String componentId) {
		return new Label(componentId, getMessage()).add(new AttributeAppender("class", "p8p"));


Then modify class MyPlugin to contribute the message gadget:

package com.example.myplugin;

import com.pmease.quickbuild.extensionpoint.StepProvider;
import com.pmease.quickbuild.extensionpoint.GadgetProvider;
import com.pmease.quickbuild.pluginsupport.AbstractPlugin;
import com.pmease.quickbuild.stepsupport.Step;

public class MyPlugin extends AbstractPlugin {

	public Object[] getExtensions() {
		return new Object[] {
			new StepProvider() {

				public Class<? extends Step> getStepClass() {
					return MyStep.class;
                        new GadgetProvider() {

                                public Class<? extends Gadget> getGadgetClass() {
                                        return MyMessageGadget.class;



With this change, the custom gadget will appear in the OTHERS category after running QuickBuild.

Besides the common gadget class, QuickBuild provides BuildBasedGadget and ConfigurationBasedGadget to facilitate creating gadgets displaying build or configuration info. Refer to the Javadoc for these classes in Eclipse for details.


Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.