Change Color of existing already exsiting Components via Viewpoint

i hope for your help.
i made a simple extension for physical components with the help of a new viewpoint.(“Extension”)
For example you can see in the attachment an easy checkbox.
Note that i don’t add new components in the form of nodes, borederd nodes etc. instead i just extend existing
components in an existing architecture.
Now i want that the color of a component changes if these is extended and i put a hook.
Is it possible and how does it work?
I tried it with the help of a java condition in the diagram part after import PAB_PC but it doesn’t work.(“Diagram PArt”)
Thanks for your help in advance.