info.magnolia.ui.vaadin.gwt.client.editor.dom
Class MgnlComponent
java.lang.Object
info.magnolia.ui.vaadin.gwt.client.editor.dom.CmsNode
info.magnolia.ui.vaadin.gwt.client.editor.dom.MgnlElement
info.magnolia.ui.vaadin.gwt.client.editor.dom.MgnlComponent
- All Implemented Interfaces:
- ComponentListener
public class MgnlComponent
- extends MgnlElement
- implements ComponentListener
Represents a component inside the 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
.
Fields inherited from class info.magnolia.ui.vaadin.gwt.client.editor.dom.CmsNode |
parent |
Methods inherited from class info.magnolia.ui.vaadin.gwt.client.editor.dom.MgnlElement |
containsAttribute, getAttribute, getAttributes, getEditElement, getEndComment, getFirstElement, getLastElement, getStartComment, isArea, isComponent, isPage, setAttributes, setControlBar, setEditElement, setEndComment, setFirstElement, setLastElement, setStartComment |
Methods inherited from class info.magnolia.ui.vaadin.gwt.client.editor.dom.CmsNode |
asMgnlElement, delete, getAreas, getAscendants, getChildren, getComponents, getDescendants, getLevel, getParent, getParentArea, getRoot, getRootArea, isRelated, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MgnlComponent
public MgnlComponent(MgnlElement parent,
com.google.gwt.event.shared.EventBus eventBus)
getTypedElement
public ComponentElement getTypedElement()
- Specified by:
getTypedElement
in class MgnlElement
editComponent
public void editComponent()
- Specified by:
editComponent
in interface ComponentListener
getLabel
public String getLabel()
- Specified by:
getLabel
in interface ComponentListener
hasEditButton
public boolean hasEditButton()
- Specified by:
hasEditButton
in interface ComponentListener
isMovable
public boolean isMovable()
- Specified by:
isMovable
in interface ComponentListener
onMoveStart
public void onMoveStart(boolean isDrag)
- Callback for
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)
.
- Specified by:
onMoveStart
in interface ComponentListener
- Parameters:
isDrag
- whether we are dragging the component or moving it
doStartMove
public 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)
.
- Parameters:
isDrag
- whether we are dragging the component or moving it
onMoveStop
public void onMoveStop()
- Callback for
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)
.
- Specified by:
onMoveStop
in interface ComponentListener
onMoveCancel
public void onMoveCancel()
- Callback for
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.
- Specified by:
onMoveCancel
in interface ComponentListener
- See Also:
unregisterMoveTarget(boolean)
setVisible
public void setVisible(boolean visible)
removeFocus
public void removeFocus()
setFocus
public void setFocus()
setMoveTarget
public void setMoveTarget(boolean moveTarget)
setMoveOver
public void setMoveOver(boolean moveTarget)
getControlBar
public ComponentBar getControlBar()
- Overrides:
getControlBar
in class MgnlElement
getHeight
public int getHeight()
getWidth
public int getWidth()
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.