private void bind(final Binding binding) {
        if (binding.getTrigger() instanceof FileChangedTrigger) {
            FileChangedTrigger t = (FileChangedTrigger) binding.getTrigger();
            List<Binding> b = fileTriggers.get(t);
            if (b == null) {
                t.init();
                b = new ArrayList<Binding>();
                fileTriggers.put(t, b);
            }
            b.add(binding);
        } else {
            final String actionName = binding.getActionName();
            inputManager.addListener(new ActionListener() {
                @Override
                public void onAction(String name, boolean isPressed, float tpf) {
                    if (actionName.equals(name) && isPressed) {
                        // reloading the material
                        binding.reload();
                    }
                }
            }, actionName);

            inputManager.addMapping(actionName, binding.getTrigger());
        }
    }
Will reload the spatial's materials whenever the shader file is changed
on the hard drive
@param shaderName the shader name (relative path to the asset folder or 
to a registered asset path)
@param spat the spatial to reload
jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java