setPaddings(5, 7, 0, 0);
setAutoScroll(true);
Label title = new Label("CREATE NEW CATEGORY");
title.setStylePrimaryName("hierarchy-title");
add(title, new AnchorLayoutData("98%"));
HTML explanationHtml = new HTML("Please enter a <b>title</b> and a sorting label (optional) for the new category.<br />" +
"Select one or more <b>parents</b> for the category by clicking on the   <img src=\"../images/add.png\"></img>   icon in the <i>Parents</i> field.<br />" +
"Operations are performed only after clicking on the <i>Create</i> button.");
explanationHtml.setStylePrimaryName("explanation");
add(explanationHtml);
titleField = new TextField("Title", "name");
titleField.setAllowBlank(false);
titleField.setEmptyText("Enter title of new category");
titleField.addListener(new TextFieldListenerAdapter() {
@Override
public void onValid(Field field) {
onTitleChange(titleField.getValueAsString());
}
});
add(titleField, new AnchorLayoutData("98%"));
sortingLabelField = new TextField("Sorting label", "code");
sortingLabelField.setAllowBlank(false);
add(sortingLabelField, new AnchorLayoutData("98%"));
//FIXME: ICD specific!!!!
parentsField = new ClassSelectionField(projectId, "Parent(s)", true, topClass);
add(parentsField, new AnchorLayoutData("98%"));
reasonField = new TextAreaField();
reasonField.setLabel("Reason for change:");
((TextArea)reasonField.getFieldComponent()).setHeight(60);
add(reasonField, new AnchorLayoutData("98%"));
HTML explanation2Html = new HTML("<b>Before creating a new category, please search for the term to ensure that you are not creating duplicates.</b><br />" +
"After you typed 4 characters in the Title field, automatic searches will show you possible matches.");
explanation2Html.setStylePrimaryName("explanation");
add(explanation2Html);
add(new HTML("<b>Possible duplicate categories:</b>"));
searchGridPanel = new SearchUtil(projectId, searchDblClickSelectable).getSearchGridPanel();
searchGridPanel.setHeight(160);
add(searchGridPanel, new AnchorLayoutData("98%"));
Button createButton = new Button("Create");
createButton.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(Button button, EventObject e) {