void (int oldKind, int kind) { myTypeChooser.setItem(kind); Arrays.stream(myFields).forEach(field -> field.setVisible(false)); myFields[kind].setVisible(true); if (METHOD == kind) { myFields[CLASS].setVisible(true); } if (PATTERN == kind && (oldKind == CLASS || oldKind == METHOD) && StringUtil.isEmpty(((TextAccessor)myFields[PATTERN]).getText())) { ((TextAccessor)myFields[PATTERN]).setText(getClassName()); } fireEditorStateChanged(); }