package jetbrains.mps.lang.typesystem.constraints; /*Generated by MPS */ import jetbrains.mps.smodel.runtime.base.BaseConstraintsDescriptor; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import java.util.Map; import org.jetbrains.mps.openapi.language.SReferenceLink; import jetbrains.mps.smodel.runtime.ReferenceConstraintsDescriptor; import java.util.HashMap; import jetbrains.mps.smodel.runtime.base.BaseReferenceConstraintsDescriptor; import jetbrains.mps.smodel.adapter.ids.MetaIdFactory; import org.jetbrains.annotations.Nullable; import jetbrains.mps.smodel.runtime.ReferenceScopeProvider; import jetbrains.mps.smodel.runtime.base.BaseScopeProvider; import jetbrains.mps.smodel.IOperationContext; import jetbrains.mps.smodel.runtime.ReferencePresentationContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SConceptOperations; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; public class InequationReference_Constraints extends BaseConstraintsDescriptor { public InequationReference_Constraints() { super(MetaAdapterFactory.getConcept(0x7a5dda6291404668L, 0xab76d5ed1746f2b2L, 0x42501924d0bd1913L, "jetbrains.mps.lang.typesystem.structure.InequationReference")); } @Override protected Map<SReferenceLink, ReferenceConstraintsDescriptor> getSpecifiedReferences() { Map<SReferenceLink, ReferenceConstraintsDescriptor> references = new HashMap<SReferenceLink, ReferenceConstraintsDescriptor>(); references.put(MetaAdapterFactory.getReferenceLink(0x7a5dda6291404668L, 0xab76d5ed1746f2b2L, 0x42501924d0bd1913L, 0x42501924d0bd1914L, "inequation"), new BaseReferenceConstraintsDescriptor(MetaIdFactory.refId(0x7a5dda6291404668L, 0xab76d5ed1746f2b2L, 0x42501924d0bd1913L, 0x42501924d0bd1914L), this) { @Nullable @Override public ReferenceScopeProvider getScopeProvider() { return new BaseScopeProvider() { @Override public boolean hasPresentation() { return true; } @Override public String getPresentation(final IOperationContext operationContext, final ReferencePresentationContext _context) { if (isNotEmptyString(SPropertyOperations.getString(_context.getParameterNode(), MetaAdapterFactory.getProperty(0x7a5dda6291404668L, 0xab76d5ed1746f2b2L, 0x11a342c1412L, 0x42501924d0bd6481L, "label")))) { return SPropertyOperations.getString(_context.getParameterNode(), MetaAdapterFactory.getProperty(0x7a5dda6291404668L, 0xab76d5ed1746f2b2L, 0x11a342c1412L, 0x42501924d0bd6481L, "label")) + " " + SConceptOperations.conceptAlias(SNodeOperations.getConcept(_context.getParameterNode())); } else { return SConceptOperations.conceptAlias(SNodeOperations.getConcept(_context.getParameterNode())); } } }; } }); return references; } private static boolean isNotEmptyString(String str) { return str != null && str.length() > 0; } }