Search in sources :

Example 1 with FeedbackTreeLayer

use of com.intellij.designer.designSurface.FeedbackTreeLayer in project intellij-community by JetBrains.

the class TreeEditOperation method isTarget.

public static boolean isTarget(RadComponent container, OperationContext context) {
    Point location = context.getLocation();
    RadComponent target = context.getArea().findTarget(location.x, location.y, null);
    if (target == container) {
        FeedbackTreeLayer layer = context.getArea().getFeedbackTreeLayer();
        return !layer.isBeforeLocation(target, location.x, location.y) && !layer.isAfterLocation(target, location.x, location.y);
    }
    return true;
}
Also used : RadComponent(com.intellij.designer.model.RadComponent) FeedbackTreeLayer(com.intellij.designer.designSurface.FeedbackTreeLayer)

Example 2 with FeedbackTreeLayer

use of com.intellij.designer.designSurface.FeedbackTreeLayer in project intellij-community by JetBrains.

the class TreeEditOperation method showFeedback.

@Override
public void showFeedback() {
    Point location = myContext.getLocation();
    FeedbackTreeLayer layer = myContext.getArea().getFeedbackTreeLayer();
    myTarget = myContext.getArea().findTarget(location.x, location.y, null);
    if (myContainer == myTarget) {
        layer.mark(myTarget, FeedbackTreeLayer.INSERT_SELECTION);
    } else if (myTarget != null && isChildren(myTarget)) {
        myInsertBefore = layer.isBeforeLocation(myTarget, location.x, location.y);
        layer.mark(myTarget, myInsertBefore ? FeedbackTreeLayer.INSERT_BEFORE : FeedbackTreeLayer.INSERT_AFTER);
    } else {
        myTarget = null;
        eraseFeedback();
    }
}
Also used : FeedbackTreeLayer(com.intellij.designer.designSurface.FeedbackTreeLayer)

Aggregations

FeedbackTreeLayer (com.intellij.designer.designSurface.FeedbackTreeLayer)2 RadComponent (com.intellij.designer.model.RadComponent)1