Examples of Syntax


Examples of aQute.bnd.help.Syntax

     *            the control
     * @param constant
     *            the constant, as mentioned in aQute.bnd.osgi.Constants
     */
    static public void setupMessageAndToolTipFromSyntax(Control control, String constant) {
        Syntax syntax = Syntax.HELP.get(constant);
        if (syntax == null) {
            logger.logError("No bnd syntax found for " + constant, null);
            syntax = new Syntax(constant, "Description of " + constant, constant + ": Example for " + constant, null, null);
        }

        String values = syntax.getValues();
        if (values != null) {
            /* filter out macros */
            values = values.replaceAll("\\$\\{[^\\}]*\\}", "");
            values = values.replaceAll(",\\s*,", ",");
            values = values.replaceAll("(^,|,$)", "");
        }
        if ((values == null) || (values.trim().length() == 0)) {
            values = "";
        } else {
            values = "\n\nProposed Values:\n" + values.trim().replaceAll("\\s*,\\s*", ", ");
        }

        String examples = getStrippedExample(syntax, constant);
        if (examples == null) {
            examples = "";
        } else {
            examples = "\n\nExample:\n" + examples;
        }

        String tt = syntax.getLead() + values + examples;
        control.setToolTipText(tt);
    }
View Full Code Here

Examples of aQute.bnd.help.Syntax

        if (hoverRegion != null) {
            IDocument doc = textViewer.getDocument();
            try {
                String key = doc.get(hoverRegion.getOffset(), hoverRegion.getLength());

                Syntax syntax = Syntax.HELP.get(key);
                if (syntax == null)
                    return null;

                StringBuilder sb = new StringBuilder();
                sb.append(syntax.getLead());
                sb.append("\nE.g. ");
                sb.append(syntax.getExample());

                String text = sb.toString();

                if (text.length() > 30) {
                    text = wrap(text, 30);
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Syntax

    assertThat(image, existsInProject());
  }

  // syntax = "proto2";
  @Test public void should_return_image_for_syntax() {
    Syntax syntax = xtext.findFirst(Syntax.class);
    String image = images.imageFor(syntax);
    assertThat(image, equalTo("syntax.gif"));
    assertThat(image, existsInProject());
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Syntax

  @Fix(SYNTAX_IS_NOT_PROTO2_ERROR)
  public void changeSyntaxToProto2(Issue issue, IssueResolutionAcceptor acceptor) {
    ISemanticModification modification = new ISemanticModification() {
      @Override public void apply(EObject element, IModificationContext context) throws Exception {
        Syntax syntax = (Syntax) element;
        syntax.setName(proto2());
      }
    };
    String description = String.format(changeValueDescription, "syntax", quote(proto2()));
    String label = String.format(changeValueLabel, proto2());
    acceptor.accept(issue, label, description, ICON_FOR_CHANGE, modification);
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

     * @param buff    IndentedLineBuffer
     */
   
    static public void serialize(Query query, IndentedLineBuffer buff)
    {
        Syntax s = query.getSyntax() ;
        if ( s == null )
            s = Syntax.defaultQuerySyntax ;
        serialize(query, buff, s) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

     * @param writer  IndentedWriter
     */
   
    static public void serialize(Query query, IndentedWriter writer)
    {
        Syntax s = query.getSyntax() ;
        if ( s == null )
            s = Syntax.defaultQuerySyntax ;
        serialize(query, writer, s) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

            System.out.println("Null action: "+entry) ;
            return null ;
        }
       
        // Defaults.
        Syntax querySyntax = TestQueryUtils.getQuerySyntax(manifest;
       
        if ( querySyntax != null )
        {
            if ( ! querySyntax.equals(Syntax.syntaxARQ) &&
                 ! querySyntax.equals(Syntax.syntaxSPARQL_10) &&
                 ! querySyntax.equals(Syntax.syntaxSPARQL_11) )
                throw new QueryTestException("Unknown syntax: "+querySyntax) ;
        }
       
        // May be null
        Resource defaultTestType = TestUtils.getResource(manifest, TestManifestX.defaultTestType) ;
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

           
            String updateSyntax = httpRequest.getParameter(paramSyntax) ;
            if ( updateSyntax == null || updateSyntax.equals("") )
                updateSyntax = "SPARQL" ;

            Syntax language = Syntax.lookup(updateSyntax) ;
            if ( language == null )
            {
                httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown syntax: "+updateSyntax) ;
                return ;
            }
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

           
            String querySyntax = httpRequest.getParameter(paramSyntax) ;
            if ( querySyntax == null || querySyntax.equals("") )
                querySyntax = "SPARQL" ;

            Syntax language = Syntax.lookup(querySyntax) ;
            if ( language == null )
            {
                httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown syntax: "+querySyntax) ;
                return ;
            }
View Full Code Here

Examples of com.hp.hpl.jena.query.Syntax

        if ( msg != null )
            out.println(msg) ;
        for ( Iterator<String> iter = Syntax.querySyntaxNames.keys() ; iter.hasNext() ; )
        {
            String k = iter.next() ;
            Syntax v = Syntax.lookup(k) ;
            k = padOut(k,10) ;
            out.println("  "+k+"  "+v) ;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.