use of org.eclipse.gef.internal.ui.palette.editparts.GroupEditPart in project archi by archimatetool.
the class PaletteViewerKeyHandler method navigateToNextContainer.
private boolean navigateToNextContainer(KeyEvent event) {
EditPart current = getFocusEditPart();
while (current != null) {
if (current instanceof DrawerEditPart || current instanceof GroupEditPart) {
List siblings = current.getParent().getChildren();
int index = siblings.indexOf(current);
if (index != -1 && siblings.size() > index + 1) {
EditPart part = (EditPart) siblings.get(index + 1);
if (part instanceof GroupEditPart && part.getChildren().size() > 0) {
EditPart child = (EditPart) part.getChildren().get(0);
navigateTo(child, event);
} else
navigateTo(part, event);
return true;
}
return false;
}
current = current.getParent();
}
return false;
}
use of org.eclipse.gef.internal.ui.palette.editparts.GroupEditPart in project archi by archimatetool.
the class PaletteViewerKeyHandler method getNavigationSiblings.
/**
* @return a list of {@link org.eclipse.gef.EditPart EditParts} that can be
* traversed to from the current
* {@link GraphicalViewerKeyHandler#getFocusEditPart() focus part}
*/
@Override
protected List getNavigationSiblings() {
ArrayList siblingsList = new ArrayList();
EditPart focusPart = getFocusEditPart();
EditPart parent = focusPart.getParent();
if (parent == null) {
siblingsList.add(focusPart);
return siblingsList;
}
if (parent instanceof GroupEditPart || parent instanceof IPaletteStackEditPart) {
EditPart grandParent = parent.getParent();
buildNavigationList(grandParent, grandParent, siblingsList, grandParent);
} else
buildNavigationList(parent, parent, siblingsList, parent);
return siblingsList;
}
Aggregations