//test not editable
VelocityContainer notEditable = createVelocityContainer("notEditable");
notEditableButton = LinkFactory.createButton("ok", notEditable, this);
Panel panel = new Panel("notEditable");
panel.setContent(notEditable);
columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, null, panel, null);
wrapperPanel = putInitialPanel(columnLayoutCtr.getInitialComponent());
return;
}
mainToolC = populateToolC(); // qtiPackage must be loaded previousely
listenTo(mainToolC);
// initialize the history
if (qtiPackage.isResumed() && qtiPackage.hasSerializedChangelog()) {
// there were already changes made -> reload!
history = qtiPackage.loadChangelog();
} else {
// start with a fresh history. Editor is resumed but no changes were made
// so far.
history = new HashMap();
}
if (restrictedEdit) {
mainToolC.setEnabled(CMD_TOOLS_ADD_SECTION, false);
mainToolC.setEnabled(CMD_TOOLS_ADD_SINGLECHOICE, false);
mainToolC.setEnabled(CMD_TOOLS_ADD_MULTIPLECHOICE, false);
mainToolC.setEnabled(CMD_TOOLS_ADD_FIB, false);
if (!qtiPackage.getQTIDocument().isSurvey()) mainToolC.setEnabled(CMD_TOOLS_ADD_KPRIM, false);
if (qtiPackage.getQTIDocument().isSurvey()) mainToolC.setEnabled(CMD_TOOLS_ADD_FREETEXT, false);
}
mainToolC.setEnabled(CMD_TOOLS_CHANGE_DELETE, false);
mainToolC.setEnabled(CMD_TOOLS_CHANGE_MOVE, false);
mainToolC.setEnabled(CMD_TOOLS_CHANGE_COPY, false);
// The menu tree model represents the structure of the qti document.
// All insert/move operations on the model are propagated to the structure
// by the node
menuTreeModel = new QTIEditorTreeModel(qtiPackage);
menuTree = new MenuTree("QTIDocumentTree");
menuTree.setTreeModel(menuTreeModel);
menuTree.setSelectedNodeId(menuTree.getTreeModel().getRootNode().getIdent());
menuTree.addListener(this);// listen to the tree
// remember the qtidoc title when we started this editor, to correctly name
// the history report
this.startedWithTitle = menuTree.getSelectedNode().getAltText();
//
main.put("tabbedPane", menuTreeModel.getQtiRootNode().createEditTabbedPane(ureq, getWindowControl(), getTranslator(), this));
main.contextPut("qtititle", menuTreeModel.getQtiRootNode().getAltText());
main.contextPut("isRestrictedEdit", restrictedEdit ? Boolean.TRUE : Boolean.FALSE);
//
columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), menuTree, mainToolC.getInitialComponent(), mainPanel, "qtieditor" + qtiPackage.getRepresentingResourceable());
listenTo(columnLayoutCtr);
// Add css background
if (restrictedEdit) {
columnLayoutCtr.addCssClassToMain("o_editor_qti_correct");
} else {