Is it possible to change attributes on buttons in macro editor window?

Hi,
I’m developing confluence macro in java . In the dialog where I’m inserting the macro, after I enter the parameters I want if they are not valid, the button insert/save from this dialog to be disabled.
Is this possible and how can I achieve this? Thanks in advance.