custom inspector material selection

I am creating a custom inspector,
is it also possible to create a material selector like we get in the inspector with a normal script when we use:

var customMaterial : Material;

Yes, just use ObjectField and specify Material as your type.