package jetbrains.mps.ide.devkit.actions; /*Generated by MPS */ import jetbrains.mps.plugins.relations.RelationDescriptor; import javax.swing.Icon; import jetbrains.mps.icons.MPSIcons; import org.jetbrains.mps.openapi.model.SNode; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import org.jetbrains.annotations.Nullable; import java.util.List; import jetbrains.mps.internal.collections.runtime.ListSequence; import java.util.ArrayList; public class Structure_TabDescriptor extends RelationDescriptor { private static final Icon ICON = MPSIcons.Nodes.Structure; public Structure_TabDescriptor() { } public String getTitle() { return "Structure"; } public Character getShortcutChar() { return 'S'; } public void startListening() { } public SNode getBaseNode(SNode node) { return ConceptEditorOpenHelper.getBaseNode(node); } public boolean isApplicable(SNode node) { return SNodeOperations.isInstanceOf(node, MetaAdapterFactory.getConcept(0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103553c5ffL, "jetbrains.mps.lang.structure.structure.AbstractConceptDeclaration")); } @Nullable public Icon getIcon() { return ICON; } public List<SNode> getNodes(SNode node) { List<SNode> list = ListSequence.fromList(new ArrayList<SNode>()); SNode n = getNode(node); if (n == null) { return list; } ListSequence.fromList(list).addElement(n); return list; } public boolean isSingle() { return true; } public SNode getNode(SNode node) { return node; } }