/**
* Presents the current open study information.
+ *
* @author Daniel Brunier-Coulin.
- *
+ *
*/
public class DisplayStudyStepAction extends AbstractDisplayAction {
* Injected study service.
*/
private StudyService _studyService;
-
+
/**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
+ * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
-
+
/**
- * Value of the title bar property.
- * It can be: study, knowledge.
+ * Value of the title bar property. It can be: study, knowledge.
*/
private String _titleProperty;
-
+
/**
- * Value of the tool bar property.
- * It can be: none, standard, study, back.
+ * Value of the tool bar property. It can be: none, standard, study, back.
*/
private String _toolProperty;
-
+
/**
- * Value of the left menu property.
- * It can be: open, study, knowledge, scenario.
+ * Value of the left menu property. It can be: open, study, knowledge, scenario.
*/
private String _leftMenuProperty;
-
+
/**
- * Property that indicates whether the current open study is editable or not.
- * On the screen it looks like pen on the status icon, pop-up menu also can be called.
- * It is necessary for correct building the title bar.
+ * Property that indicates whether the current open study is editable or not. On the screen it looks like pen on the status icon, pop-up
+ * menu also can be called. It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
res = ERROR;
}
}
- if (!ERROR.equals(res)){
+ if (!ERROR.equals(res)) {
// Initialization of menus
ProjectElement owner = _openStudy.getSelectedStep().getOwner();
- SimpleMenu menu = ApplicationSettings.getMenu("configuration");
+ SimpleMenu menu = getApplicationSettings().getMenu("configuration");
if (owner instanceof Scenario) {
menu.enables(Constants.PROP_SCENARIO);
menu.selects(Constants.PROP_SCENARIO);
menu.selects("prop-general");
}
getSession().put("menu.study", _openStudy.getMenu());
-
+
setMenuProperty(Constants.STUDY_MENU);
setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.STANDARD_MENU);
}
-
+
setLeftMenuProperty(Constants.STUDY_MENU);
-
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
}
return res;
}
}
// Re-initialization of the properties menu according to the selected step
ProjectElement owner = _openStudy.getSelectedStep().getOwner();
- SimpleMenu menu = ApplicationSettings.getMenu("configuration");
+ SimpleMenu menu = getApplicationSettings().getMenu("configuration");
if (owner instanceof Scenario) {
menu.enables(Constants.PROP_SCENARIO);
menu.selects(Constants.PROP_SCENARIO);
menu.disables(Constants.PROP_SCENARIO);
menu.selects("prop-general");
}
-
+
setMenuProperty(Constants.STUDY_MENU);
setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.STANDARD_MENU);
}
-
+
setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
return SUCCESS;
}
} else if (todo == Execute.reduceall) {
_openStudy.reduceDocument(_myindex);
}
-
+
setMenuProperty(Constants.STUDY_MENU);
setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.STANDARD_MENU);
}
setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
return SUCCESS;
}
} else if (todo == Execute.reduce) {
_openStudy.reduceKnowledge(_myindex);
}
-
+
setMenuProperty(Constants.STUDY_MENU);
setTitleProperty(Constants.STUDY_MENU);
- if (Constants.TRUE.equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty(Constants.STANDARD_MENU);
}
setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
return SUCCESS;
}
public String doClose() {
closeStudy();
-
+
setMenuProperty("none");
initializationScreenContext(_menuProperty);
-
+
return SUCCESS;
}
super.setOpenStudy(study);
_openStudy = study;
}
-
+
/**
* Get the menuProperty.
+ *
* @return the menuProperty
*/
public String getMenuProperty() {
/**
* Set the menuProperty.
- * @param menuProperty the menuProperty to set
+ *
+ * @param menuProperty
+ * the menuProperty to set
*/
public void setMenuProperty(final String menuProperty) {
this._menuProperty = menuProperty;
}
-
+
/**
* Get the _titleProperty.
+ *
* @return the _titleProperty
*/
public String getTitleProperty() {
/**
* Set the _titleProperty.
- * @param _titleProperty the titleProperty to set
+ *
+ * @param _titleProperty
+ * the titleProperty to set
*/
public void setTitleProperty(final String titleProperty) {
_titleProperty = titleProperty;
/**
* Get the editDisabledProperty.
+ *
* @return the editDisabledProperty
*/
public String getEditDisabledProperty() {
/**
* Set the editDisabledProperty.
- * @param editDisabledProperty the editDisabledProperty to set
+ *
+ * @param editDisabledProperty
+ * the editDisabledProperty to set
*/
public void setEditDisabledProperty(final String editDisabledProperty) {
_editDisabledProperty = editDisabledProperty;
}
-
+
/**
* Get the toolProperty.
+ *
* @return the toolProperty
*/
public String getToolProperty() {
/**
* Set the toolProperty.
- * @param toolProperty the toolProperty to set
+ *
+ * @param toolProperty
+ * the toolProperty to set
*/
public void setToolProperty(final String toolProperty) {
_toolProperty = toolProperty;
}
-
+
/**
* Get the leftMenuProperty.
+ *
* @return the leftMenuProperty
*/
public String getLeftMenuProperty() {
/**
* Set the leftMenuProperty.
- * @param leftMenuProperty the leftMenuProperty to set
+ *
+ * @param leftMenuProperty
+ * the leftMenuProperty to set
*/
public void setLeftMenuProperty(final String leftMenuProperty) {
_leftMenuProperty = leftMenuProperty;