我想通过使用EPartService来获取活动部件。我可以使用EPartService吗?
答案 0 :(得分:0)
如果你想在命令处理程序中获取活动部分,可以将其作为参数注入:
EPartService
如果您需要所有当前显示部件的列表,可以使用@Inject
MApplication app;
@Inject
EPartService partService;
// Find all the `MPart` objects in the current presentation
Collection<MPart> parts = partService.getParts();
// Filter the list to include just the parts that are current being displayed (rendered)
parts = parts.stream().filter(MPart::isToBeRendered).collect(Collectors.toList());
。类似的东西:
function remove($allowedCharacters, $value)
{
$newDict = $allowedCharacters;
if(($key = array_search($value, $newDict)))
{
unset($newDict[$key]);
}
return $newDict;
}
注意:此代码需要Java 8