use of com.android.tools.idea.uibuilder.handlers.ViewEditorImpl in project android by JetBrains.
the class NlActionManager method addViewActions.
public void addViewActions(@NotNull DefaultActionGroup group, @Nullable NlComponent component, @Nullable NlComponent parent, @NotNull List<NlComponent> newSelection, boolean toolbar) {
ScreenView screenView = mySurface.getCurrentScreenView();
if (screenView == null || (parent == null && component == null)) {
return;
}
ViewEditor editor = new ViewEditorImpl(screenView);
// TODO: Perform caching
if (component != null) {
ViewHandler handler = ViewHandlerManager.get(mySurface.getProject()).getHandler(component);
addViewActionsForHandler(group, component, newSelection, editor, handler, toolbar);
}
if (parent != null) {
ViewHandler handler = ViewHandlerManager.get(mySurface.getProject()).getHandler(parent);
List<NlComponent> selectedChildren = Lists.newArrayListWithCapacity(newSelection.size());
for (NlComponent selected : newSelection) {
if (selected.getParent() == parent) {
selectedChildren.add(selected);
}
}
addViewActionsForHandler(group, parent, selectedChildren, editor, handler, toolbar);
}
}
Aggregations