public class MgnlComponent extends MgnlElement implements ComponentListener
CmsNode
-tree.
Implements a listener interface for the associated ComponentBar
.
Handles DnD and move Events for components and provides wrapper functions used by the FocusModel
.ACTIVATION_STATUS_KEY
Constructor and Description |
---|
MgnlComponent(MgnlElement parent,
com.google.gwt.event.shared.EventBus eventBus) |
Modifier and Type | Method and Description |
---|---|
void |
doStartMove(boolean isDrag)
Registers the sibling components as move targets and registers a handler for
ComponentStopMoveEvent on the source component which will call sortComponent(MgnlComponent) . |
void |
edit() |
int |
getActivationStatus() |
protected ComponentBar |
getControlBar() |
String |
getLabel() |
MoveWidget |
getMoveWidget() |
ComponentElement |
getTypedElement() |
boolean |
hasEditButton() |
boolean |
isMovable() |
void |
onAction(String actionName,
Map<String,String> parameters) |
void |
onMoveCancel()
Callback for
ComponentBar source when a drag is stopped. |
void |
onMoveStart(boolean isDrag)
Callback for
ComponentBar when starting a drag or move event. |
void |
onMoveStop()
Callback for
ComponentBar targets when a move or drag event is dropped on or moved to this target. |
void |
removeFocus() |
void |
setFocus() |
void |
setMoveOver(boolean moveTarget) |
void |
setMoveTarget(boolean moveTarget) |
void |
setVisible(boolean visible) |
containsAttribute, getAttribute, getAttributes, getEditElement, getEndComment, getFirstElement, getLastElement, getStartComment, isArea, isComponent, isInherited, isPage, preserve, setAttributes, setControlBar, setEditElement, setEndComment, setFirstElement, setLastElement, setStartComment
asMgnlElement, delete, getAreas, getAscendants, getChildren, getComponents, getDescendants, getLevel, getParent, getParentArea, getRoot, getRootArea, isRelated, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute
public MgnlComponent(MgnlElement parent, com.google.gwt.event.shared.EventBus eventBus)
public ComponentElement getTypedElement()
getTypedElement
in class MgnlElement
public void edit()
edit
in interface ControlBarListener
public void onAction(String actionName, Map<String,String> parameters)
onAction
in interface ComponentListener
public String getLabel()
public boolean hasEditButton()
public int getActivationStatus()
public boolean isMovable()
public void onMoveStart(boolean isDrag)
ComponentBar
when starting a drag or move event. Depending on whether it is a drag or a move
it will either notify the server by firing a ComponentStartMoveEvent
or register the handlers in doStartMove(boolean)
.onMoveStart
in interface ComponentListener
isDrag
- whether we are dragging the component or moving itpublic void doStartMove(boolean isDrag)
ComponentStopMoveEvent
on the source component which will call sortComponent(MgnlComponent)
.isDrag
- whether we are dragging the component or moving itpublic void onMoveStop()
ComponentBar
targets when a move or drag event is dropped on or moved to this target.
Fires ComponentStopMoveEvent
to notify the system. Holds itself as payload for handling by the source,
see handler registered in doStartMove(boolean)
.onMoveStop
in interface ComponentListener
public void onMoveCancel()
ComponentBar
source when a drag is stopped.
Fires ComponentStopMoveEvent
to notify the system about the cancel. Will cause target components to
unregister themselves as targets.onMoveCancel
in interface ComponentListener
unregisterMoveTarget(boolean)
public void setVisible(boolean visible)
public void removeFocus()
public void setFocus()
public void setMoveTarget(boolean moveTarget)
public void setMoveOver(boolean moveTarget)
protected ComponentBar getControlBar()
getControlBar
in class MgnlElement
public MoveWidget getMoveWidget()
Copyright © 2019 Magnolia International Ltd.. All rights reserved.