Don't quote me on this, but from what I've seen in the api, you'll first need to get the configs for the attack style.
i believe this is '43' and values range from 0 upwards, 0 being attack, then you need to get the widget id's for the given style you want to switch and write a piece of code for it.
int currentAttackStyle = getConfigs().get(43);
if (currentAttackStyle == 0 && getSkills().getDynamic(Skill.ATTACK) > 10) {
// current attack style is 'attack' and our player has an attack level higher then 10
// this is where you now want to perform widget interactions to change the given attack style to one of your choice.
}
Should be enough information here for you to accomplish what you need, I'd also advise you taking a look at:
it's a very helpful resource.