To create a plugin using interfaces through metadata, follow these steps:
- First, create the interface, which is created as a class initially, using the following lines of code:
public interface ConWHSVehicleColorable { public Color Color() { } }
- We will need a class that implements this interface. Create a class named ConWHSVehicleGroupColorRed, which will simply return the string literal Red, as shown here:
class ConWHSVehicleGroupColorRed implements ConWHSVehicleColorable { public Color Color() { return 'Red'; } }
- To keep logic away from the form and simplify usage, create a class named ConWHSVehicleGroupColorSetupForm.
- Next, create a static lookup method. The pattern should be familiar from the previous ...