use of org.eclipse.gef.palette.PaletteStack 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);
}
}
use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.
the class PaletteStackFactory method createNewEntry.
/**
* @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#createNewEntry(org.eclipse.swt.widgets.Shell,
* org.eclipse.gef.palette.PaletteEntry)
*/
@Override
public PaletteEntry createNewEntry(Shell shell, PaletteEntry selected) {
PaletteContainer parent = determineContainerForNewEntry(selected);
int index = determineIndexForNewEntry(parent, selected);
PaletteEntry entry = createNewEntry(shell);
parent.remove(selected);
parent.add(index - 1, entry);
((PaletteStack) entry).add(selected);
entry.setUserModificationPermission(PaletteEntry.PERMISSION_FULL_MODIFICATION);
return entry;
}
Aggregations