package jetbrains.mps.lang.actions.testLanguage.editor;
/*Generated by MPS */
import jetbrains.mps.nodeEditor.menus.substitute.SubstituteMenuBase;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import jetbrains.mps.lang.editor.menus.MenuPart;
import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuItem;
import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuContext;
import java.util.ArrayList;
import jetbrains.mps.lang.editor.menus.GroupMenuPart;
import jetbrains.mps.util.Computable;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import java.util.Arrays;
import jetbrains.mps.lang.editor.menus.substitute.IncludeSubstituteMenuSubstituteMenuPart;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.openapi.editor.menus.substitute.SubstituteMenuLookup;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.lang.editor.menus.substitute.NamedSubstituteMenuLookup;
import jetbrains.mps.smodel.language.LanguageRegistry;
import jetbrains.mps.lang.editor.menus.ConceptMenusPart;
import java.util.Collection;
import jetbrains.mps.smodel.ConceptDescendantsCache;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.lang.editor.menus.substitute.DefaultSubstituteMenuLookup;
public class ActionTestDefaultAbstractChild_SubstituteMenu extends SubstituteMenuBase {
@NotNull
@Override
protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts(final SubstituteMenuContext _context) {
List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> result = new ArrayList<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>();
result.add(new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a());
return result;
}
public class SMP_Group_c1nwm3_a extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> {
private boolean condition;
private boolean condition1;
private boolean condition2;
@Override
protected void initialize(SubstituteMenuContext _context) {
super.initialize(_context);
condition = new Computable<Boolean>() {
public Boolean compute() {
return eq_c1nwm3_a0a0a0a0a0b0d1(_context.getLink(), MetaAdapterFactory.getContainmentLink(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x2365c14e1671696fL, 0x73dfe0fc257b7aaaL, "removeDefaultsPart"));
}
}.compute();
condition1 = new Computable<Boolean>() {
public Boolean compute() {
return eq_c1nwm3_a0a0a0a0a0c0d1(_context.getLink(), MetaAdapterFactory.getContainmentLink(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x2365c14e1671696fL, 0x73dfe0fc2552e60aL, "removeByConditionPart"));
}
}.compute();
condition2 = new Computable<Boolean>() {
public Boolean compute() {
return eq_c1nwm3_a0a0a0a0a0d0d1(_context.getLink(), MetaAdapterFactory.getContainmentLink(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x2365c14e1671696fL, 0x73dfe0fc25762f5fL, "removePart"));
}
}.compute();
}
@Override
protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() {
return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a.SMP_Include_c1nwm3_a0(), new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a.SMP_Include_c1nwm3_b0(), new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a.SMP_Include_c1nwm3_c0(), new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a.SMP_Group_c1nwm3_d0());
}
public class SMP_Include_c1nwm3_a0 extends IncludeSubstituteMenuSubstituteMenuPart {
@Nullable
@Override
protected SubstituteMenuLookup getMenuLookup(SubstituteMenuContext _context) {
final EditorContext editorContext = _context.getEditorContext();
return new NamedSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x73dfe0fc25514b8dL, "jetbrains.mps.lang.actions.testLanguage.structure.ActionTestDefaultAbstractChild"), "jetbrains.mps.lang.actions.testLanguage.editor.RemoveDefaultsPart");
}
}
public class SMP_Include_c1nwm3_b0 extends IncludeSubstituteMenuSubstituteMenuPart {
@Nullable
@Override
protected SubstituteMenuLookup getMenuLookup(SubstituteMenuContext _context) {
final EditorContext editorContext = _context.getEditorContext();
return new NamedSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x73dfe0fc25514b8dL, "jetbrains.mps.lang.actions.testLanguage.structure.ActionTestDefaultAbstractChild"), "jetbrains.mps.lang.actions.testLanguage.editor.RemoveByConditionPart");
}
}
public class SMP_Include_c1nwm3_c0 extends IncludeSubstituteMenuSubstituteMenuPart {
@Nullable
@Override
protected SubstituteMenuLookup getMenuLookup(SubstituteMenuContext _context) {
final EditorContext editorContext = _context.getEditorContext();
return new NamedSubstituteMenuLookup(LanguageRegistry.getInstance(editorContext.getRepository()), MetaAdapterFactory.getConcept(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x73dfe0fc25514b8dL, "jetbrains.mps.lang.actions.testLanguage.structure.ActionTestDefaultAbstractChild"), "jetbrains.mps.lang.actions.testLanguage.editor.RemovePart");
}
}
public class SMP_Group_c1nwm3_d0 extends GroupMenuPart<SubstituteMenuItem, SubstituteMenuContext> {
@Override
protected boolean isApplicable(SubstituteMenuContext _context) {
return !((condition || condition1 || condition2));
}
@Override
protected List<MenuPart<SubstituteMenuItem, SubstituteMenuContext>> getParts() {
return Arrays.<MenuPart<SubstituteMenuItem, SubstituteMenuContext>>asList(new ActionTestDefaultAbstractChild_SubstituteMenu.SMP_Group_c1nwm3_a.SMP_Group_c1nwm3_d0.SMP_Subconcepts_c1nwm3_a3a());
}
public class SMP_Subconcepts_c1nwm3_a3a extends ConceptMenusPart<SubstituteMenuItem, SubstituteMenuContext> {
protected Collection getConcepts(final SubstituteMenuContext _context) {
return ConceptDescendantsCache.getInstance().getDirectDescendants(MetaAdapterFactory.getConcept(0x737ed1fffa634ebcL, 0xa834435499b23c64L, 0x73dfe0fc25514b8dL, "jetbrains.mps.lang.actions.testLanguage.structure.ActionTestDefaultAbstractChild"));
}
@Override
protected Collection<SubstituteMenuItem> createItemsForConcept(SubstituteMenuContext context, SAbstractConcept concept) {
return context.createItems(new DefaultSubstituteMenuLookup(LanguageRegistry.getInstance(context.getEditorContext().getRepository()), concept));
}
}
}
}
private static boolean eq_c1nwm3_a0a0a0a0a0b0d1(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
private static boolean eq_c1nwm3_a0a0a0a0a0c0d1(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
private static boolean eq_c1nwm3_a0a0a0a0a0d0d1(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
}