use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart in project webtools.sourceediting by eclipse.
the class ConnectableEditPart method activateConnection.
protected void activateConnection() {
if (connectionFigures == null) {
connectionFigures = new ArrayList();
}
for (Iterator i = getChildren().iterator(); i.hasNext(); ) {
Object o = i.next();
if (o instanceof BaseEditPart) {
BaseEditPart g = (BaseEditPart) o;
ReferenceConnection figure = createConnectionFigure(g);
connectionFigures.add(figure);
figure.setPoints(figure.getPoints());
getLayer(LayerConstants.CONNECTION_LAYER).add(figure);
}
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.BaseEditPart in project webtools.sourceediting by eclipse.
the class GraphNodeDragTracker method performAdditionalSelection.
protected void performAdditionalSelection() {
EditPartViewer viewer = getCurrentViewer();
// like-edit part figures from other parents, should be unselected.
if (getCurrentInput().isShiftKeyDown()) {
// This list contains the fields
List list = editPart.getParent().getChildren();
// Get the index of the current selection
int currentIndex = list.indexOf(editPart);
// List of all the currently selected edit parts
List currentSelected = viewer.getSelectedEditParts();
int size = currentSelected.size();
if (size > 0) {
Object lastSelected = currentSelected.get(size - 1);
if (lastSelected instanceof BaseEditPart) {
// Here, we determine the upper and lower limit of the indices
int lowerIndex = -1, upperIndex = -1;
int lastSelectedIndex = list.indexOf(lastSelected);
if (lastSelectedIndex >= 0 && lastSelectedIndex < currentIndex) {
lowerIndex = lastSelectedIndex;
upperIndex = currentIndex;
} else if (lastSelectedIndex >= 0 && lastSelectedIndex > currentIndex) {
lowerIndex = currentIndex;
upperIndex = lastSelectedIndex;
}
if (lowerIndex >= 0 && upperIndex >= 0) {
for (int i = lowerIndex; i < upperIndex; i++) {
viewer.appendSelection((EditPart) list.get(i));
}
}
}
}
}
}
Aggregations