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 |
editComponent() |
int |
getActivationStatus() |
ComponentBar |
getControlBar() |
int |
getHeight() |
String |
getLabel() |
ComponentElement |
getTypedElement() |
int |
getWidth() |
boolean |
hasEditButton() |
boolean |
isMovable() |
void |
onComponentAction(String actionName,
String... args) |
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, 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 editComponent()
editComponent
in interface ComponentListener
public void onComponentAction(String actionName, String... args)
onComponentAction
in interface ComponentListener
public String getLabel()
getLabel
in interface ComponentListener
public boolean hasEditButton()
hasEditButton
in interface ComponentListener
public int getActivationStatus()
getActivationStatus
in interface ComponentListener
public boolean isMovable()
isMovable
in interface ComponentListener
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)
public ComponentBar getControlBar()
getControlBar
in class MgnlElement
public int getHeight()
public int getWidth()
Copyright © 2016 Magnolia International Ltd.. All rights reserved.