blob: 72d901af135a1e73c7cf027839279ced82b478c1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006, 2007 Sybase, Inc. and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Sybase, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.pagedesigner.validation.caret;
import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
/**
* @author mengbo
*/
public interface IPositionRule extends IValidationRule {
/**
* To see if the node is editable. For inline editing, this means whether
* can we input something into the target. For DnD, this means whether can
* we drag and drop something into it.
*
* @param target
* @return true if target is editable
*/
public boolean isEditable(Target target);
/**
* To see if the node itself or its descendent is editable.
*
* @param target
* @return true if target is editable
*/
public boolean hasEditableArea(Target target);
/**
* Whether can we place caret against this part's border. Some container we
* are consider white box, and whitespace may not be suitable for caret
* reference.
*
* @param target
* @param atRight
* TODO
* @return true if can reference target
*/
public boolean canReference(Target target, boolean atRight);
/**
* To see if the position is valid. Please note, the container is editable
* means there is a child area whithin it is editable, the position may be
* in an inEditable place. So this method is different from hasEditableArea
* and isEditable.
*
* @param position
* @return true if position is valid
*/
public boolean isValidPosition(IDOMPosition position);
}