* Edit menu item name.
*/
private static final String MNU_NAME_EDIT = "menu.edit";
+ /**
+ * Edit menu item name.
+ */
+ private static final String MNU_NAME_REMOVE = "menu.remove";
/**
* Script menu item name.
*/
/**
* Remove menu item name.
*/
- private static final String MNU_NAME_REMOVE = "menu.remove.version";
+ private static final String MNU_NAME_REMOVE_VERSION = "menu.remove.version";
/**
* Rename menu item name.
*/
_projectSettings = projectSettingsService;
}
+ /**
+ * New study menu.
+ */
private static class NewMenu extends SimpleMenu {
+ /**
+ * New study menu constructor.
+ */
private NewMenu() {
super("create");
addItem("new-empty", "menu.new.empty", "image.empty.png",
"select?menu=create&item=new-empty");
- addItem("new-copy", new MenuItem("menu.new.copy")
- .icon("image.copy.png"));
+ addItem("new-copy", "menu.new.copy", "image.copy.png",
+ "select?menu=create&item=new-copy");
/*
* addItem("new-instance", new MenuItem("menu.new.instance") .icon(IMG_HOLD)); addItem("new-import", new
* MenuItem("menu.new.import") .icon("icon.upload.png"));
}
}
+ /**
+ * Search menu.
+ */
private static class SearchMenu extends SimpleMenu {
+ /**
+ * Search menu constructor.
+ */
private SearchMenu() {
super("search");
addItem("search-study", "menu.search.study", "image.study.png",
}
}
+ /**
+ * Configuration menu.
+ */
private static class PropertiesMenu extends SimpleMenu {
+ /**
+ * Configuration menu constructor.
+ */
private PropertiesMenu() {
super("configuration");
addItem("prop-general", "menu.prop.general", IMG_HOLD,
}
}
+ /**
+ * Data administrator menu.
+ */
private static class DatadminMenu extends SimpleMenu {
+ /**
+ * Data administrator menu constructor.
+ */
private DatadminMenu() {
super("datadmin");
addItem("admin-scontext", "menu.admin.context", IMG_HOLD,
}
}
+ /**
+ * System administrator menu.
+ */
private static class SysadminMenu extends SimpleMenu {
+ /**
+ * System administrator menu constructor.
+ */
private SysadminMenu() {
super("sysadmin");
addItem("admin-indexing", "menu.admin.indexing", "image.index.png",
};
// Resources relative to studies
+ /**
+ * Study popup menu.
+ */
private static class EditableMarkedStudyPopup extends PopupMenu {
+ /**
+ * User rights for the selected study.
+ */
private transient StudyRights _user = null;
- private EditableMarkedStudyPopup(final boolean isPublic, final boolean isMarked) {
+ /**
+ * Study popup menu constructor.
+ *
+ * @param isPublic
+ * public study flag
+ * @param isMarked
+ * "marked as reference" study flag
+ */
+ private EditableMarkedStudyPopup(final boolean isPublic,
+ final boolean isMarked) {
super();
-
+
if (isMarked) {
addItem(MNU_MARK_AS_REFERENCE, new PopupItem(
- MNU_NAME_REMOVE_AS_REFERENCE).action(ACT_REMOVE_AS_REFERENCE)
- .confirmation("message.removeasreference.study"));
+ MNU_NAME_REMOVE_AS_REFERENCE).action(
+ ACT_REMOVE_AS_REFERENCE).confirmation(
+ "message.removeasreference.study"));
} else {
- addItem(MNU_MARK_AS_REFERENCE, new PopupItem(MNU_NAME_MARK_AS_REFERENCE)
- .action(ACT_MARK_AS_REFERENCE).confirmation(
+ addItem(MNU_MARK_AS_REFERENCE, new PopupItem(
+ MNU_NAME_MARK_AS_REFERENCE).action(
+ ACT_MARK_AS_REFERENCE).confirmation(
"message.markasreference.study"));
}
-
+
if (isPublic) {
addItem(MNU_PUBLISH, new PopupItem(MNU_NAME_PROTECT).icon(
- "image.publish.png").action("edit-study?action=protect")
- .confirmation("message.protect.study"));
+ "image.publish.png")
+ .action("edit-study?action=protect").confirmation(
+ "message.protect.study"));
} else {
addItem(MNU_PUBLISH, new PopupItem(MNU_NAME_PUBLISH).icon(
- "image.publish.png").action("edit-study?action=publish")
- .confirmation("message.publish.study"));
+ "image.publish.png")
+ .action("edit-study?action=publish").confirmation(
+ "message.publish.study"));
}
/* addItem(MNU_PROMOTE, new PopupItem("menu.archive")); */
addSeparator();
addItem(MNU_EDIT, new PopupItem("menu.properties").icon(
- "icon.ed.png").action("../select?menu=configuration&item=prop-general"));
+ "icon.ed.png").action(
+ "../select?menu=configuration&item=prop-general"));
addSeparator();
addItem(MNU_SCRIPT, new PopupItem(MNU_NAME_SCRIPT)
.action("add-scenario"));
/*
* addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE) .confirmation("message.purge.study")); addItem("export", new
* PopupItem("menu.export") .icon("image.export.png")); // For future needs
- */addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(
+ */addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE_VERSION).icon(
IMG_DELETE).action("remove-study").confirmation(
"message.delete.study"));
}
boolean history = _user.getOperand().isVersioned();
PopupItem item = this.item(MNU_REMOVE);
if (history) {
- item.rename(MNU_NAME_REMOVE);
+ item.rename(MNU_NAME_REMOVE_VERSION);
} else {
item.rename("menu.remove.study");
}
* Popup of In-Work documents.
*/
private static class EditableDocumentPopup extends PopupMenu {
+ /**
+ * User rights for the selected document.
+ */
private transient DocumentRights _user = null;
+ /**
+ * Document popup menu constructor.
+ */
private EditableDocumentPopup() {
super();
addItem("accept", new PopupItem("menu.accept").icon(
addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE).action(
ACT_NOT_YET_IMPLEMENTED).confirmation(
"message.purge.document"));
- addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
- .action("remove-document").confirmation(
- "message.delete.document"));
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE_VERSION).icon(
+ IMG_DELETE).action("remove-document").confirmation(
+ "message.delete.document"));
}
@Override
Document downer = _user.getOperand();
PopupItem item = this.item(MNU_REMOVE);
if (downer.isVersioned()) {
- item.rename(MNU_NAME_REMOVE);
+ item.rename(MNU_NAME_REMOVE_VERSION);
} else {
item.rename("menu.remove.document");
}
* Popup of In-Draft documents.
*/
private static class ReviewableDocumentPopup extends PopupMenu {
+ /**
+ * User rights for the selected document.
+ */
private transient DocumentRights _user = null;
+ /**
+ * Document popup menu constructor.
+ */
private ReviewableDocumentPopup() {
super();
addItem(MNU_DEMOTE, new PopupItem(MNU_NAME_DEMOTE).icon(
addItem(MNU_PURGE, new PopupItem(MNU_NAME_PURGE).action(
ACT_NOT_YET_IMPLEMENTED).confirmation(
"message.purge.document"));
- addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
- .action("remove-document").confirmation(
- "message.delete.document"));
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE_VERSION).icon(
+ IMG_DELETE).action("remove-document").confirmation(
+ "message.delete.document"));
}
}
addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT)
.action("edit-context?action=editContext"));
addSeparator();
- addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE)
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
.action("remove-context").confirmation(
"message.delete.context"));
}
addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT)
.action("edit-knowledge?action=editKnowledge"));
addSeparator();
- addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE)
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
.action("remove-knowledge").confirmation(
"message.delete.knowledge"));
}
}
}
}
-
+
/**
* Pop-up menu for comments.
*/
super();
addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT).icon("icon.ed.png")
.action("editComment(entity_index)"));
- addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE)
- .action("removeComment(entity_index)").confirmation("message.delete.comment"));
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
+ .action("removeComment(entity_index)").confirmation(
+ "message.delete.comment"));
}
/**
* Is enabled.
- * @param name the entry name
+ *
+ * @param name
+ * the entry name
* @return true
*/
@Override
return true;
}
}
-
+
/**
* Pop-up menu for comments.
*/
super();
addItem(MNU_EDIT, new PopupItem(MNU_NAME_EDIT).icon("icon.ed.png")
.action("showDescriptionEditor()"));
- addItem(MNU_REMOVE, new PopupItem("menu.remove").icon(IMG_DELETE)
- .action("removeDescription()")
- .confirmation("message.delete.description"));
+ addItem(MNU_REMOVE, new PopupItem(MNU_NAME_REMOVE).icon(IMG_DELETE)
+ .action("removeDescription()").confirmation(
+ "message.delete.description"));
}
/**
* Is enable.
- * @param name the entry name
+ *
+ * @param name
+ * the entry name
* @return true
*/
@Override
_menus.put(menu.getName(), menu);
_popups = new HashMap<String, PopupMenu>();
- _popups.put("steditablemarkpublic", new EditableMarkedStudyPopup(false, false));
- _popups.put("steditableunmarkpublic", new EditableMarkedStudyPopup(false, true));
- _popups.put("steditablemarkprivate", new EditableMarkedStudyPopup(true, false));
- _popups.put("steditableunmarkprivate", new EditableMarkedStudyPopup(true, true));
+ _popups.put("steditablemarkpublic", new EditableMarkedStudyPopup(false,
+ false));
+ _popups.put("steditableunmarkpublic", new EditableMarkedStudyPopup(
+ false, true));
+ _popups.put("steditablemarkprivate", new EditableMarkedStudyPopup(true,
+ false));
+ _popups.put("steditableunmarkprivate", new EditableMarkedStudyPopup(
+ true, true));
_popups.put("editable", new EditableDocumentPopup());
_popups.put("notresult", new NotResultDocumentPopup());
_popups.put("reviewable", new ReviewableDocumentPopup());