blob: d02733fbb8f96675d8bed49e2702aa6d1a3db369 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 Sybase, Inc. and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sybase, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.pagedesigner.viewer;
import org.eclipse.gef.EditPart;
/**
* @author mengbo
*/
public class DesignRefPosition extends DesignPosition {
private boolean _caretIsAtRight;
private EditPart _refPart;
/**
* @param part
* @param offset
*/
public DesignRefPosition(EditPart part, boolean caretIsAfter) {
super(part.getParent(), 0);
int offset = part.getParent().getChildren().indexOf(part);
_offset = caretIsAfter ? offset + 1 : offset;
_refPart = part;
_caretIsAtRight = caretIsAfter;
}
public EditPart getRefPart() {
return _refPart;
}
/**
* @return Returns the _isAfter.
*/
public boolean caretIsAtRight() {
return _caretIsAtRight;
}
}