本文整理汇总了Java中org.eclipse.graphiti.palette.IPaletteCompartmentEntry类的典型用法代码示例。如果您正苦于以下问题:Java IPaletteCompartmentEntry类的具体用法?Java IPaletteCompartmentEntry怎么用?Java IPaletteCompartmentEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPaletteCompartmentEntry类属于org.eclipse.graphiti.palette包,在下文中一共展示了IPaletteCompartmentEntry类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pruneDisabledPaletteEntries
import org.eclipse.graphiti.palette.IPaletteCompartmentEntry; //导入依赖的package包/类
/**
* Prunes the disabled palette entries from the
* {@link IPaletteCompartmentEntry}.
*
* @param entry
* the compartment being pruned
*/
private void pruneDisabledPaletteEntries(final IProject project, final IPaletteCompartmentEntry entry) {
final Set<PaletteEntry> disabledPaletteEntries = ExtensionUtil.getDisabledPaletteEntries(project);
if (!disabledPaletteEntries.isEmpty()) {
final Iterator<IToolEntry> entryIterator = entry.getToolEntries().iterator();
while (entryIterator.hasNext()) {
final IToolEntry toolEntry = entryIterator.next();
if (disabledPaletteEntries.contains(PaletteEntry.ALL)) {
entryIterator.remove();
} else {
if (toolEntry instanceof ObjectCreationToolEntry) {
final ObjectCreationToolEntry objToolEntry = (ObjectCreationToolEntry) toolEntry;
if (toolMapping.containsKey(objToolEntry.getCreateFeature().getClass())) {
if (disabledPaletteEntries.contains(toolMapping.get(objToolEntry.getCreateFeature().getClass()))) {
entryIterator.remove();
}
}
}
}
}
}
}