class AbstractFormItem implements FormItem<T> {

    @Override
    public void attach() {
        if (form != null) {
            // if there's a back reference use it to attach only the appearances which are supported by the form
            for (Map.Entry<State, Appearance<T>> entry : appearances.entrySet()) {
                State state = entry.getKey();
                if (form.getStateMachine().supports(state)) {
                    Appearance<T> appearance = entry.getValue();
                    appearance.attach();
                }
            }
            if (form.getStateMachine().supports(State.EDITING) && suggestHandler instanceof Attachable) {
                ((Attachable) suggestHandler).attach();
            }

        } else {
            appearances.values().forEach(Appearance::attach);
            if (suggestHandler instanceof Attachable) {
                ((Attachable) suggestHandler).attach();
            }
        }
    }

      AbstractFormItem(String name, String label, String hint);

}