FileDocCategorySizeDatePackage
UiLayoutEditPart.javaAPI DocAndroid 1.5 API3457Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.layout.parts

UiLayoutEditPart

public final class UiLayoutEditPart extends UiElementEditPart
Graphical edit part for an {@link UiElementNode} that represents a ViewLayout.

It acts as a simple container.

Fields Summary
private final HighlightInfo
mHighlightInfo
Constructors Summary
public UiLayoutEditPart(com.android.ide.eclipse.editors.uimodel.UiElementNode uiElementNode)

    
       
        super(uiElementNode);
    
Methods Summary
protected voidcreateEditPolicies()

        super.createEditPolicies();
        
        installEditPolicy(EditPolicy.CONTAINER_ROLE, new ContainerEditPolicy() {
            @Override
            protected Command getCreateCommand(CreateRequest request) {
                return null;
            }
        });
        
        installLayoutEditPolicy(this);
    
protected org.eclipse.draw2d.IFigurecreateFigure()

        IFigure f = new LayoutFigure();
        f.setLayoutManager(new XYLayout());
        return f;
    
public voidhideDropTarget()

        mHighlightInfo.clear();
        IFigure f = getFigure();
        if (f instanceof LayoutFigure) {
            ((LayoutFigure) f).setHighlighInfo(mHighlightInfo);
        }
    
protected voidhideSelection()

        IFigure f = getFigure();
        if (f instanceof ElementFigure) {
            ((ElementFigure) f).setSelected(false);
        }
    
public voidshowDropTarget(org.eclipse.draw2d.geometry.Point where)

        if (where != null) {
            mHighlightInfo.clear();
            mHighlightInfo.drawDropBorder = true;
            DropFeedback.computeDropFeedback(this, mHighlightInfo, where);

            IFigure f = getFigure();
            if (f instanceof LayoutFigure) {
                ((LayoutFigure) f).setHighlighInfo(mHighlightInfo);
            }
        }
    
protected voidshowSelection()

        IFigure f = getFigure();
        if (f instanceof ElementFigure) {
            ((ElementFigure) f).setSelected(true);
        }