info.magnolia.ui.vaadin.gwt.client.editor.dom
Class MgnlComponent

java.lang.Object
  extended by info.magnolia.ui.vaadin.gwt.client.editor.dom.CmsNode
      extended by info.magnolia.ui.vaadin.gwt.client.editor.dom.MgnlElement
          extended by 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.


Field Summary
 
Fields inherited from class info.magnolia.ui.vaadin.gwt.client.editor.dom.CmsNode
parent
 
Constructor Summary
MgnlComponent(MgnlElement parent, com.google.gwt.event.shared.EventBus eventBus)
           
 
Method Summary
 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()
           
 ComponentBar getControlBar()
           
 int getHeight()
           
 String getLabel()
           
 ComponentElement getTypedElement()
           
 int getWidth()
           
 boolean hasEditButton()
           
 boolean isMovable()
           
 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)
           
 
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
 

Constructor Detail

MgnlComponent

public MgnlComponent(MgnlElement parent,
                     com.google.gwt.event.shared.EventBus eventBus)
Method Detail

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.