"menuOptions"))
{
public void populateItem(final ListItem listItem)
{
final MenuSeparatorDefinition separator = (MenuSeparatorDefinition) listItem
.getModelObject();
listItem.add(new Label("text", separator.getText()));
listItem.add(new Label("title", separator.getTitle()));
AjaxLink editLink = new AjaxLink("edit")
{
@Override
public void onClick(AjaxRequestTarget target)
{
metaDataModalWindow.setContent(new SeparatorWindow(
metaDataModalWindow.getContentId(),separator, ajaxPanel));
metaDataModalWindow.show(target);
}
};
editLink.add(new Label("editLabel",new ResourceModel("common.edit")));
listItem.add(editLink);
AjaxLink deleteLink = new AjaxLink("delete")
{
@Override
public void onClick(AjaxRequestTarget target)
{
menuActions(REMOVE_ACTION, separator.getText() ,new SeparatorDefinitionBean());
target.addComponent(ajaxPanel);
}
};
deleteLink.add(new Label("deleteLabel",new ResourceModel("common.delete")));
deleteLink.add(new JavascriptEventConfirmation("onclick",new ResourceModel("action.delete.confirm")));
listItem.add(deleteLink);
}
});
Form separtorForm = new Form("sepForm");
add(separtorForm);
add(new AjaxButton("new",new ResourceModel("common.new"),separtorForm)
{
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
MenuSeparatorDefinition separatorDefinition = null;
if (getUserSelectedNode().getDocType() == FileType.Folder)
{
separatorDefinition = getServiceLocator()
.getPageManager()
.newFolderMenuSeparatorDefinition();