String (final RadComponent component, String text) { if (StringUtil.startsWithIgnoreCase(text, PREFIX_HTML)) { text = Pattern.compile("<.+?>").matcher(text).replaceAll(""); } ArrayList<String> words = new ArrayList<>(StringUtil.getWordsIn(text)); if (words.size() > 0) { StringBuilder nameBuilder = new StringBuilder(StringUtil.decapitalize(words.get(0))); for(int i=1; i<words.size() && i < 4; i++) { nameBuilder.append(StringUtil.capitalize(words.get(i))); } final String shortClassName = StringUtil.capitalize(InsertComponentProcessor.getShortClassName(component.getComponentClassName())); if (shortClassName.equalsIgnoreCase(nameBuilder.toString())) { // avoid "buttonButton" case return null; } nameBuilder.append(shortClassName); RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(component); Project project = root.getProject(); String binding = JavaCodeStyleManager.getInstance(project).propertyNameToVariableName(nameBuilder.toString(), VariableKind.FIELD); if (FormEditingUtil.findComponentWithBinding(root, binding, component) != null) { binding = InsertComponentProcessor.getUniqueBinding(root, nameBuilder.toString()); } return binding; } return null; }