Button for simple visual no-nonsense non-abstract folder format handl

I need a button which has these properties:

  1. If the cursor is in a directory which has no saved folder format:
    1.1 Button is not selected and button is enabled
    1.2 Clicking on this button saves the current folder format in this directory (one-click action)
    2 If the cursor is in a directory which HAS a saved folder format which has not been changed:
    2.1 Button IS selected and button is not enabled
    3 If the cursor is in a directory which HAS a saved folder format which HAS been changed:
    3.1 Button IS selected and button is enabled
    3.2 Clicking on this button restores the saved folder format in this directory

Is this possible?

There is no way to do all of that in a single button, no.