public class DefaultCommentLayerComponentController extends Object implements CommentLayerComponentController<CommentLayerComponent>
CommentLayerComponentController.| Modifier and Type | Field and Description |
|---|---|
protected ModelHelper |
cockpitModelHelper |
protected TypeService |
cockpitTypeService |
protected static String |
COMMENT_LAYER_ARG_NAME |
protected static String |
COMMENTLAYER_INDEX |
protected CommentLayerService |
commentLayerService |
protected CommentService |
commentService |
protected TooltipRenderer |
commentTooltipRenderer |
protected CommentTypeModel |
commentType |
protected ComponentModel |
component |
protected DomainModel |
domain |
protected static Logger |
LOG |
protected ModelService |
modelService |
protected static String |
NORMAL_BORDER |
protected UIAccessRightService |
uiAccessRightService |
| Constructor and Description |
|---|
DefaultCommentLayerComponentController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCommentIcon(CommentLayerComponent commentLayerComponent,
int x_Position,
int y_Position)
Appends new comment icon on the
commentLayercomponent at the x,y position. |
protected void |
addExistingComments(CommentLayerComponent commentLayerComponent) |
boolean |
canCreateComment()
Checks if current user can create new comment instances.
|
protected boolean |
canCreateComment(TypedObject commentTarget) |
boolean |
canDeleteComment(CommentModel comment)
Evaluates if current user is eligible to delete the target comment instance.
|
boolean |
canEditComment(CommentModel comment)
Evaluates if current user can edit a comment behind the comment icon on the comment layer component.
|
boolean |
canMoveCommentIcon(CommentIcon icon)
Evaluates if current user can move given comment on the comment layer.
|
boolean |
canReplyToComment(CommentModel comment)
Evaluates if current user can reply to a comment behind the comment icon on the comment layer component.
|
void |
changeCommentLayerMode(CommentLayerComponent component,
String mode)
Changes the mode of the comment layer component.
|
void |
changeCommentLayerMode(CommentLayerContext context,
String mode)
Changes the mode of all comment layer components in the context.
|
void |
changeCommentLayerToDefaultMode(CommentLayerComponent component)
Changes the mode of the target comment layer component to default mode.
|
void |
changeCommentLayerToDefaultMode(CommentLayerContext context)
Changes the mode of all comment layer components in the context to default mode.
|
protected CockpitBasicFCKEditor |
createCockpitFCKEditor(Map<String,? extends Object> editorParameters) |
protected CommentMetadataModel |
createCommentMetadata(CommentLayerComponentModel model,
CommentModel commentToSave,
CommentIcon newIcon) |
Menupopup |
createContextMenu(CommentLayerComponent component)
Creates context menu component for the right-click actions on the comment layer
|
protected void |
createEditPopupContentForComment(Window newCommentPopup,
CommentLayerComponent clComponent,
CommentLayerAwareModel clAwareModel,
CommentIcon newIcon,
CommentModel commentToEdit,
boolean create)
Create additional content for comment creation and edit popup.
|
protected Window |
createEditPopupForComment(CommentLayerAwareModel clAwareModel,
CommentIcon newIcon,
CommentModel commentToEdit,
boolean create) |
protected Window |
createEditPopupForComment(CommentLayerComponent clComponent,
CommentLayerAwareModel clAwareModel,
CommentIcon newIcon,
CommentModel commentToEdit,
boolean create) |
Menupopup |
createIconContextMenu(CommentLayerComponent component,
CommentIcon icon)
Creates context menu component for the right-click actions on the icons on comment layer
|
protected CommentIcon |
createNewIcon(CommentIconModel model) |
protected Window |
createReplyPopup(CommentLayerAwareModel model,
AbstractCommentModel abstractCommentModel,
boolean edit) |
void |
deleteCommentFromCommentLayer(CommentLayerComponent component,
CommentIcon icon)
Removes the given icon from the target comment layer component.
|
protected boolean |
displayCommentIcon(TypedObject commentLayerTarget,
CommentMetadataModel metaData)
Determines if comment icon represented by the meta data should be displayed over given
commentLayerTerget. |
protected boolean |
displayCommentIcon(TypedObject commentLayerTarget,
CommentMetadataModel metaData,
int pageIndex)
Determines if comment icon represented by the meta data should be displayed over given
commentLayerTerget. |
void |
drawCommentLayerOverArea(HtmlBasedComponent parent,
CommentLayerComponent commentLayerComponent)
Draws the comment layer over the given parent
html component. |
void |
editCommentPopup(CommentLayerAwareModel model,
AbstractCommentModel abstractComment)
Method for rendering popup for reply edit.
|
CommentIcon |
getCommentIconForComment(CommentLayerComponent component,
CommentModel comment)
Returns CommentIcon component for the given
CommentModel which is placed on the given
CommentLayerComponent; |
protected CommentTypeModel |
getCommentType() |
protected UserModel |
getCurentUser() |
protected ComponentModel |
getCurrentComponent() |
protected double[] |
getDimensionsFromParent(HtmlBasedComponent area) |
protected DomainModel |
getDomain() |
protected int |
getPagePreviewIndex(ItemModel commentLayerTarget)
Computes preview index basing on the comet file code.
|
protected Integer |
getRealPositionCoordinate(int scaledCoordinate,
double scaleFactor) |
protected TypeService |
getTypeService() |
double[] |
getWidthAndHeight(CommentLayerComponent component,
double scaleFactor)
Return comment layer dimensions according to the given scale factor.
|
void |
moveCommentIcon(CommentLayerComponent commentLayerComponent,
CommentIcon icon,
int x_Position,
int y_Position)
Moves the target comment icon on the comment layer component to the target position (x, y).
|
protected void |
prepareCommentUpdate(Window newCommentPopup,
AbstractCommentModel commentToSave,
boolean create)
Prepare comment for saving.
|
protected void |
prepareReplyUpdate(Window replyPopup,
AbstractCommentModel abstractCommentModel,
boolean edit)
Prepare comment for saving.
|
CommentIcon |
refreshCommentIcon(CommentIcon icon)
Refreshes the instance of comment icon.
|
void |
refreshContextList(CommentLayerAwareModel commentLayerAwareModel,
boolean refreshItems)
Tries to perform refresh of the
ContextAreaCommentTreeComponent |
protected void |
renderSimpleDecisionNavigation(HtmlBasedComponent container,
Button positiveButton,
Button negativeButton) |
void |
replyComment(CommentLayerAwareModel model,
AbstractCommentModel abstractCommentModel)
Renders reply popup for the
AbstractCommentModel instance. |
void |
selectCommentIcon(CommentLayerComponent commentLayerComponent,
CommentIcon icon)
Marks the target icon as selected on the given comment layer component.
|
void |
setCockpitModelHelper(ModelHelper cockpitModelHelper) |
void |
setCockpitTypeService(TypeService cockpitTypeService) |
protected void |
setCommentAttachments(CommentModel comment,
Object currentValue) |
void |
setCommentLayerService(CommentLayerService commentLayerService) |
void |
setCommentService(CommentService commentService) |
void |
setCommentTooltipRenderer(TooltipRenderer commentTooltipRenderer) |
void |
setModelService(ModelService modelService) |
void |
setUiAccessRightService(UIAccessRightService uiAccessRightService) |
protected void |
updateComment(CommentModel comment,
ObjectValueContainer ovc,
String text) |
protected void |
updateComponentIcon(CommentLayerComponent clComponent,
CommentIcon newIcon,
CommentModel commentToSave) |
protected void |
validateCommentLayer(CommentLayerComponent component) |
protected static final String NORMAL_BORDER
protected static final Logger LOG
protected static final String COMMENT_LAYER_ARG_NAME
protected static final String COMMENTLAYER_INDEX
protected DomainModel domain
protected ComponentModel component
protected CommentTypeModel commentType
protected CommentService commentService
protected ModelService modelService
protected ModelHelper cockpitModelHelper
protected TypeService cockpitTypeService
protected CommentLayerService commentLayerService
protected UIAccessRightService uiAccessRightService
protected TooltipRenderer commentTooltipRenderer
public DefaultCommentLayerComponentController()
public void drawCommentLayerOverArea(HtmlBasedComponent parent,
CommentLayerComponent commentLayerComponent)
CommentLayerComponentControllerhtml component. Comment icons corresponding to the
current state of the model will also be drawn on the layer. The comments are found from the data base according to
the :
CommentLayerComponentModel.getCommentTarget() andCommentLayerComponentModel.getCommentLayerTarget()drawCommentLayerOverArea in interface CommentLayerComponentController<CommentLayerComponent>parent - - comment layer targetcommentLayerComponent - - comment layer to drawpublic Menupopup createContextMenu(CommentLayerComponent component)
CommentLayerComponentControllercreateContextMenu in interface CommentLayerComponentController<CommentLayerComponent>component - - comment layer componentpublic boolean canCreateComment()
CommentLayerComponentControllercanCreateComment in interface CommentLayerComponentController<CommentLayerComponent>protected boolean canCreateComment(TypedObject commentTarget)
public Menupopup createIconContextMenu(CommentLayerComponent component, CommentIcon icon)
CommentLayerComponentControllercreateIconContextMenu in interface CommentLayerComponentController<CommentLayerComponent>icon - - icon from a comment layer componentprotected void addExistingComments(CommentLayerComponent commentLayerComponent)
protected boolean displayCommentIcon(TypedObject commentLayerTarget, CommentMetadataModel metaData)
commentLayerTerget.commentLayerTarget - metaData - - meta data of the comment under investigationprotected boolean displayCommentIcon(TypedObject commentLayerTarget, CommentMetadataModel metaData, int pageIndex)
commentLayerTerget.commentLayerTarget - metaData - - meta data of the comment under investigationprotected int getPagePreviewIndex(ItemModel commentLayerTarget)
protected double[] getDimensionsFromParent(HtmlBasedComponent area)
public void changeCommentLayerMode(CommentLayerComponent component, String mode)
CommentLayerComponentControllerchangeCommentLayerMode in interface CommentLayerComponentController<CommentLayerComponent>component - CommentLayerComponentmode - - Please use one of the out-of-the-box modes or any other, customized mode.public void changeCommentLayerToDefaultMode(CommentLayerComponent component)
CommentLayerComponentControllerchangeCommentLayerToDefaultMode in interface CommentLayerComponentController<CommentLayerComponent>component - CommentLayerComponentpublic void addCommentIcon(CommentLayerComponent commentLayerComponent, int x_Position, int y_Position)
CommentLayerComponentControllercommentLayercomponent at the x,y position. Calling this method
will create:
CommentLayerComponentModel.getCommentTarget() )CommentMetadataModel ) with the comment layer target item ( i.
e Page preview in print cockpit CommentLayerComponentModel.getCommentLayerTarget()).addCommentIcon in interface CommentLayerComponentController<CommentLayerComponent>commentLayerComponent - - componentx_Position - - x position (left)y_Position - - y position (top)public void deleteCommentFromCommentLayer(CommentLayerComponent component, CommentIcon icon)
CommentLayerComponentControllerdeleteCommentFromCommentLayer in interface CommentLayerComponentController<CommentLayerComponent>component - - Comment layer componenticon - - icon to removepublic void selectCommentIcon(CommentLayerComponent commentLayerComponent, CommentIcon icon)
CommentLayerComponentControllerCommentIconModel.isSelected() is set to true and also currently selected icon is unselected.selectCommentIcon in interface CommentLayerComponentController<CommentLayerComponent>commentLayerComponent - - parent comment CommentLayerComponent component.icon - - icon to select.public CommentIcon getCommentIconForComment(CommentLayerComponent component, CommentModel comment)
CommentLayerComponentControllerCommentModel which is placed on the given
CommentLayerComponent;getCommentIconForComment in interface CommentLayerComponentController<CommentLayerComponent>CommentIcon or null if no such icon was found.protected UserModel getCurentUser()
protected DomainModel getDomain()
protected ComponentModel getCurrentComponent()
protected CommentTypeModel getCommentType()
protected void prepareCommentUpdate(Window newCommentPopup,
AbstractCommentModel commentToSave,
boolean create)
newCommentPopup - commentToSave - create - protected void prepareReplyUpdate(Window replyPopup,
AbstractCommentModel abstractCommentModel,
boolean edit)
replyPopup - abstractCommentModel - edit - protected void updateComment(CommentModel comment, ObjectValueContainer ovc, String text)
protected void setCommentAttachments(CommentModel comment, Object currentValue)
protected Integer getRealPositionCoordinate(int scaledCoordinate, double scaleFactor)
protected void validateCommentLayer(CommentLayerComponent component)
public void refreshContextList(CommentLayerAwareModel commentLayerAwareModel, boolean refreshItems)
CommentLayerComponentControllerContextAreaCommentTreeComponentrefreshContextList in interface CommentLayerComponentController<CommentLayerComponent>protected TypeService getTypeService()
public boolean canEditComment(CommentModel comment)
CommentLayerComponentControllercanEditComment in interface CommentLayerComponentController<CommentLayerComponent>public boolean canReplyToComment(CommentModel comment)
CommentLayerComponentControllerCommentPermissionCheckStrategy, which can be customized per
project installation.canReplyToComment in interface CommentLayerComponentController<CommentLayerComponent>comment - - target CommentModelpublic boolean canMoveCommentIcon(CommentIcon icon)
CommentLayerComponentControllercanMoveCommentIcon in interface CommentLayerComponentController<CommentLayerComponent>icon - - target CommentIconpublic boolean canDeleteComment(CommentModel comment)
CommentLayerComponentControllerCommentPermissionCheckStrategy, which can be customized per project installation.canDeleteComment in interface CommentLayerComponentController<CommentLayerComponent>comment - - target CommentModelprotected void createEditPopupContentForComment(Window newCommentPopup,
CommentLayerComponent clComponent,
CommentLayerAwareModel clAwareModel,
CommentIcon newIcon,
CommentModel commentToEdit,
boolean create)
newCommentPopup - clComponent - clAwareModel - newIcon - commentToEdit - create - protected Window createEditPopupForComment(CommentLayerComponent clComponent, CommentLayerAwareModel clAwareModel, CommentIcon newIcon, CommentModel commentToEdit, boolean create)
protected CommentMetadataModel createCommentMetadata(CommentLayerComponentModel model, CommentModel commentToSave, CommentIcon newIcon)
protected void updateComponentIcon(CommentLayerComponent clComponent, CommentIcon newIcon, CommentModel commentToSave)
protected Window createEditPopupForComment(CommentLayerAwareModel clAwareModel, CommentIcon newIcon, CommentModel commentToEdit, boolean create)
protected void renderSimpleDecisionNavigation(HtmlBasedComponent container,
Button positiveButton,
Button negativeButton)
public void moveCommentIcon(CommentLayerComponent commentLayerComponent, CommentIcon icon, int x_Position, int y_Position)
CommentLayerComponentControllermoveCommentIcon in interface CommentLayerComponentController<CommentLayerComponent>commentLayerComponent - - CommentLayerComponenticon - - CommentIcon to be movedx_Position - - target x position (HtmlBasedComponent#setLeft(String))y_Position - - target x position (HtmlBasedComponent#setTop(String))protected CockpitBasicFCKEditor createCockpitFCKEditor(Map<String,? extends Object> editorParameters)
protected Window createReplyPopup(CommentLayerAwareModel model, AbstractCommentModel abstractCommentModel, boolean edit)
protected CommentIcon createNewIcon(CommentIconModel model)
public void replyComment(CommentLayerAwareModel model, AbstractCommentModel abstractCommentModel)
CommentLayerComponentControllerAbstractCommentModel instance.replyComment in interface CommentLayerComponentController<CommentLayerComponent>model - - model of the active comment layerabstractCommentModel - - instance to replypublic CommentIcon refreshCommentIcon(CommentIcon icon)
CommentLayerComponentControllerCommentModel
instance residing in the CommentIconModel.refreshCommentIcon in interface CommentLayerComponentController<CommentLayerComponent>icon - - CommentIcon to refreshCommentIconpublic void editCommentPopup(CommentLayerAwareModel model, AbstractCommentModel abstractComment)
CommentLayerComponentControllereditCommentPopup in interface CommentLayerComponentController<CommentLayerComponent>model - - CommentLayerAwareModelabstractComment - - AbstractCommentModel to editpublic double[] getWidthAndHeight(CommentLayerComponent component, double scaleFactor)
CommentLayerComponentControllergetWidthAndHeight in interface CommentLayerComponentController<CommentLayerComponent>component - - Comment layerscaleFactor - -target scale factorpublic void setCommentLayerService(CommentLayerService commentLayerService)
public void setCommentService(CommentService commentService)
public void setModelService(ModelService modelService)
public void setCockpitTypeService(TypeService cockpitTypeService)
public void setUiAccessRightService(UIAccessRightService uiAccessRightService)
public void setCockpitModelHelper(ModelHelper cockpitModelHelper)
public void changeCommentLayerMode(CommentLayerContext context, String mode)
CommentLayerComponentControllerchangeCommentLayerMode in interface CommentLayerComponentController<CommentLayerComponent>context - - CommentLayerContextmode - - Please use one of the out-of-the-box modes or any other, customized mode.public void changeCommentLayerToDefaultMode(CommentLayerContext context)
CommentLayerComponentControllerchangeCommentLayerToDefaultMode in interface CommentLayerComponentController<CommentLayerComponent>context - - CommentLayerContextpublic void setCommentTooltipRenderer(TooltipRenderer commentTooltipRenderer)
Copyright © 2017 SAP SE. All Rights Reserved.