import org.apache.log4j.Logger;
import org.splat.dal.bo.kernel.User;
import org.splat.som.ApplicationRights;
+import org.splat.som.StudyRights;
import org.splat.dal.bo.som.KnowledgeElement;
import org.splat.dal.bo.som.SimulationContextType;
import org.splat.dal.bo.som.Study;
import org.splat.dal.bo.som.DocumentType;
import org.splat.wapp.Menu;
+import org.splat.wapp.PopupMenu;
/**
* TitleBarSettings bean.
*/
private TitleBarSettings _titleBarSettings;
+ /**
+ * ToolBarSettings bean.
+ */
+ private ToolBarSettings _toolBarSettings;
+
/**
* Injected application settings bean.
*/
getMenuBarSettings().setIsStudyNull(true);
} else {
getMenuBarSettings().setIsStudyNull(false);
+
+ //for initialization ToolBarSettings.canUserEdit property
+ // and ToolBarSettings.isEnabledScript property.
+
+ OpenStudy currentStudy = (OpenStudy)session.get("study.open");
+ PopupMenu popup = currentStudy.getPopup();
+ StudyRights user = currentStudy.getStudyRights();
+
+ if(user.canEditProperties()) {
+ getToolBarSettings().setCanUserEdit(true);
+ } else {
+ getToolBarSettings().setCanUserEdit(false);
+ }
+
+ if (popup == null) {
+ getToolBarSettings().setIsEnabledScript(false);
+ } else if (popup.isEnabled("script")) {
+ getToolBarSettings().setIsEnabledScript(true);
+ } else {
+ getToolBarSettings().setIsEnabledScript(false);
+ }
}
if (session.get("knowledge.open") == null) {
getTitleBarSettings().setProgressState(entity.getProgressState().toString());
getTitleBarSettings().setSelectionState(entity.getSelection());
- getTitleBarSettings().setEntryType(entity.getType());
+ getTitleBarSettings().setEntryType(entity.getType().toLowerCase());
+ getTitleBarSettings().setEntryTypeTitle(entity.getType());
getTitleBarSettings().setEntryTitle(entity.getTitle());
getTitleBarSettings().setEditDisabledProperty(editDisabledProperty);
}
}
/**
- * Initialization of the screen context for menu bar and tool bar.
+ * Initialization of the screen context for menu bar and title bar.
*
* @param menuProperty - the property of the menu bar.
* @param titleProperty - The title of the open study/knowledge.
initializationContext(titleProperty, editDisabledProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
}
+
+ /**
+ * Initialization of the screen context for menu bar, title bar and tool bar.
+ *
+ * @param menuProperty - the property of the menu bar.
+ * @param titleProperty - The title of the open study/knowledge.
+ * @param editDisabledProperty - Property that indicates whether the current open study is editable or not.
+ * @param toolProperty - the property of the tool bar.
+ */
+ public void initializationScreenContext(final String menuProperty,
+ final String titleProperty, final String editDisabledProperty,
+ final String toolProperty) {
+
+ initializationScreenContext(menuProperty, titleProperty, editDisabledProperty);
+ getToolBarSettings().intializeMenuBar(toolProperty);
+ }
+
+ /**
+ * Initialization of the screen context for menu bar and tool bar.
+ *
+ * @param menuProperty - the property of the menu bar.
+ * @param toolProperty - the property of the tool bar.
+ */
+ public void initializationScreenContext(final String menuProperty,
+ final String toolProperty) {
+
+ initializationContext();
+ getMenuBarSettings().intializeMenuBar(menuProperty);
+ getToolBarSettings().intializeMenuBar(toolProperty);
+ }
// ==============================================================================================================================
// Getters and setters
// ==============================================================================================================================
public void setTitleBarSettings(TitleBarSettings titleBarSettings) {
_titleBarSettings = titleBarSettings;
}
+ /**
+ * Get the toolBarSettings.
+ * @return the toolBarSettings
+ */
+ public final ToolBarSettings getToolBarSettings() {
+ return _toolBarSettings;
+ }
+ /**
+ * Set the toolBarSettings.
+ * @param toolBarSettings the toolBarSettings to set
+ */
+ public final void setToolBarSettings(ToolBarSettings toolBarSettings) {
+ _toolBarSettings = toolBarSettings;
+ }
+
/**
* Get the applicationSettings.
* @return the applicationSettings