contentPanel.setHeaderVisible(false);
contentPanel.setScrollMode(Scroll.AUTO);
contentPanel.setStyleName("tc-right-panel");
final TCSection tcSection = new TCSection(section, TCSection.MODE_RIGHT_MATCHING);
// create menu
ToolBar mb = new ToolBar();
mb.setWidth("100%");
// cancel
createCancelToolbarButton(mb, "Cancel", contentSection.getSelectedItemsId());
//
mb.add(new SeparatorToolItem());
// Selected paragraph
Button selectionMenuHead = new Button("Selected Paragraph");
Menu selectionMenu = new Menu();
selectionMenuHead.setMenu(selectionMenu);
mb.add(selectionMenuHead);
Button getInformation = new Button("More Information");
getInformation.setIconStyle("icon-menu-information");
getInformation.addSelectionListener(new SelectionListener<ButtonEvent>(){
@Override
public void componentSelected(ButtonEvent ce) {
String id = tcSection.getSelectedItemsId();
if(null == id)
Window.alert("Please select item");
else
Commands.getInstance().getInformationOn(id, ClientUtils.DERIVED);
}
});
selectionMenu.add(getInformation);
selectionMenu.add(new SeparatorMenuItem());
Button createLink = new Button("Create Link");
createLink.addSelectionListener(new SelectionListener<ButtonEvent>(){
@Override
public void componentSelected(ButtonEvent ce) {
try{
LinkableItem linkItem = tcSection.getLinkableItem();
Commands.getInstance().createLink(contentSection.getSelectedItemsId(),linkItem );
} catch(IllegalStateException e){
Window.alert("Please select item");
}
}