public static GLSLPresentation createFieldPresentation(GLSLDeclarator declarator) { String result = ""; GLSLQualifiedType type = declarator.getQualifiedType(); GLSLQualifier[] qualifiers = type.getQualifiers(); if (qualifiers.length > 0) { result += prettyPrint( stringify( qualifiers, new Stringifyer<GLSLQualifier>() { public String stringify(GLSLQualifier glslQualifier) { return glslQualifier == null ? "null" : glslQualifier.getText(); } })); result += " "; } result += declarator.getName(); result += " : "; result += type.getType().getTypename(); GLSLPresentation presentation = new GLSLPresentation(result); presentation.setIcon(FIELD); return presentation; }
public static GLSLPresentation createFieldPresentation( String type, GLSLDeclarator[] declarators) { String dec = prettyPrint( stringify( declarators, new Stringifyer<GLSLDeclarator>() { public String stringify(GLSLDeclarator glslDeclarator) { GLSLIdentifier identifier = glslDeclarator.getNameIdentifier(); if (identifier == null) return "(unknown)"; else return identifier.getName(); } })); GLSLPresentation presentation = new GLSLPresentation(dec + " : " + type); presentation.setIcon(FIELD); return presentation; }
public static GLSLPresentation createStructPresentation(String structName) { GLSLPresentation presentation = new GLSLPresentation(structName); presentation.setIcon(STRUCT); return presentation; }
public static GLSLPresentation createFilePresentation(String name) { GLSLPresentation presentation = new GLSLPresentation(name); presentation.setIcon(GLSLSupportLoader.GLSL.getIcon()); return presentation; }
public static GLSLPresentation createMethodPresentation(String name, String... parameters) { GLSLPresentation presentation = new GLSLPresentation(name + " " + prettyPrint(parameters)); presentation.setIcon(FUNCTION); return presentation; }
public static GLSLPresentation createPrototypePresentation(String name) { GLSLPresentation presentation = new GLSLPresentation(name); presentation.setIcon(PROTOTYPE); return presentation; }