use of org.eclipse.gef.internal.ui.palette.editparts.PaletteStackEditPart in project archi by archimatetool.
the class PaletteViewer method reveal.
/**
* @see ScrollingGraphicalViewer#reveal(EditPart)
*/
@Override
public void reveal(EditPart part) {
// If the given part is a drawer, we don't need to expand it. Hence,
// when invoking
// findContainingDrawer(), we use part.getParent()
DrawerEditPart drawer = findContainingDrawer(part.getParent());
if (drawer != null && !drawer.isExpanded())
drawer.setExpanded(true);
// stack.
if (part.getParent() != null && part.getParent() instanceof PaletteStackEditPart)
((PaletteStack) part.getParent().getModel()).setActiveEntry((PaletteEntry) part.getModel());
super.reveal(part);
}
use of org.eclipse.gef.internal.ui.palette.editparts.PaletteStackEditPart in project archi by archimatetool.
the class PaletteViewerKeyHandler method buildNavigationList.
private void buildNavigationList(EditPart palettePart, EditPart exclusion, ArrayList navList, EditPart stackPart) {
if (palettePart != exclusion) {
if (isCollapsedDrawer(palettePart)) {
navList.add(palettePart);
return;
} else if (stackPart instanceof PaletteStackEditPart && stackPart.getChildren().contains(palettePart)) {
// we only want to add the top level item to the navlist
if (((PaletteStack) stackPart.getModel()).getActiveEntry().equals(palettePart.getModel()))
navList.add(palettePart);
} else if (stackPart instanceof PinnablePaletteStackEditPart && stackPart.getChildren().contains(palettePart)) {
// the palette stack is expanded
if (((PinnablePaletteStackEditPart) stackPart).isExpanded() || ((PaletteStack) stackPart.getModel()).getActiveEntry().equals(palettePart.getModel())) {
navList.add(palettePart);
}
} else if ((palettePart instanceof ToolEntryEditPart || palettePart instanceof DrawerEditPart || palettePart instanceof TemplateEditPart)) {
navList.add(palettePart);
}
}
List children = palettePart.getChildren();
for (int k = 0; k < children.size(); k++) {
EditPart ep = (EditPart) children.get(k);
if (ep instanceof IPaletteStackEditPart)
stackPart = ep;
buildNavigationList(ep, exclusion, navList, stackPart);
}
}
Aggregations