Example #1
0
  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;
  }
Example #2
0
 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;
 }
Example #3
0
 public static GLSLPresentation createStructPresentation(String structName) {
   GLSLPresentation presentation = new GLSLPresentation(structName);
   presentation.setIcon(STRUCT);
   return presentation;
 }
Example #4
0
 public static GLSLPresentation createFilePresentation(String name) {
   GLSLPresentation presentation = new GLSLPresentation(name);
   presentation.setIcon(GLSLSupportLoader.GLSL.getIcon());
   return presentation;
 }
Example #5
0
 public static GLSLPresentation createMethodPresentation(String name, String... parameters) {
   GLSLPresentation presentation = new GLSLPresentation(name + " " + prettyPrint(parameters));
   presentation.setIcon(FUNCTION);
   return presentation;
 }
Example #6
0
 public static GLSLPresentation createPrototypePresentation(String name) {
   GLSLPresentation presentation = new GLSLPresentation(name);
   presentation.setIcon(PROTOTYPE);
   return presentation;
 }