Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.ContextInformation


    }

    public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
        List<IContextInformation> result = new LinkedList<IContextInformation>();

        result.add(new ContextInformation("contextDisplayString", "informationDisplayString"));

        return result;
    }
View Full Code Here


          }
        }
      }
    }
    if (!info.toString().trim().equals("")) {
      return new IContextInformation[]{new ContextInformation(contextString, info.toString())};
    }
    else {
      return EMPTY_CONTEXT_INFO;
    }
  }
View Full Code Here

    return proposalsList.toArray(new ICompletionProposal[0]);
  }
  private CompletionProposal createCompletionProposal(String keyWord, WordPartDetector wordPart, String wordType)
  {
    IContextInformation info =
      new ContextInformation(keyWord, getContentInfoString(keyWord));

    // TODO: get descriptions from Django web site
    String descr = "Django template tag";
    if (wordType.equals("FILTER"))
      descr = "Django template filter";
View Full Code Here

    return proposalsList.toArray(new ICompletionProposal[0]);
  }
  private CompletionProposal createCompletionProposal(String keyWord, WordPartDetector wordPart, String wordType)
  {
    String aInfoStr = getContentInfoString(keyWord);
    IContextInformation info = new ContextInformation(keyWord, aInfoStr);

    // TODO: get descriptions from Django web site
    String descr = "Django template tag";
    if (wordType.equals("FILTER"))
      descr = "Django template filter";
View Full Code Here

    return false;
  }

  @Override
  public IContextInformation getContextInformation() {
    return new ContextInformation(getDisplayString(), getDisplayString());
  }
View Full Code Here

  @Override
  public IContextInformation[] computeContextInformation(ITextViewer viewer,
      int offset) {
    IContextInformation[] result= new IContextInformation[5];
    for (int i= 0; i < result.length; i++)
      result[i]= new ContextInformation(
        MessageFormat.format("{0} at position {1}", new Object[] { new Integer(i), new Integer(offset) }),
        MessageFormat.format("{0} valid from {1} to {2}", new Object[] { new Integer(i), new Integer(offset - 5), new Integer(offset + 5)}));
    return result;
  }
View Full Code Here

  @Override
  public IContextInformation[] computeContextInformation(ITextViewer viewer,
      int offset) {
    IContextInformation[] result= new IContextInformation[5];
    for (int i= 0; i < result.length; i++)
      result[i]= new ContextInformation(
        MessageFormat.format("{0} at position {1}", new Object[] { new Integer(i), new Integer(offset) }),
        MessageFormat.format("{0} valid from {1} to {2}", new Object[] { new Integer(i), new Integer(offset - 5), new Integer(offset + 5)}));
    return result;
  }
View Full Code Here

              || text.startsWith(qualifier.proposal.toString()))
          {
            // Derive cursor position
            int cursor = text.length();

            IContextInformation contextInfo = new ContextInformation(null, text);
            // Construct proposal
            CompletionProposal proposal = new CompletionProposal(text, documentOffset
                - qlen, qlen, cursor, null, text, contextInfo, text
                + "-Event declared in contract");

            // and add to result list
            propList.add(proposal);
          }
        }

        for (IVariable var : model.getContract().getMonitoredVariables())
        {

          String text = var.getName();
          if (qualifier.proposal.toString().trim().length() == 0
              || text.startsWith(qualifier.proposal.toString()))
          {
            // Derive cursor position
            int cursor = text.length();

            IContextInformation contextInfo = new ContextInformation(null, text);
            // Construct proposal
            CompletionProposal proposal = new CompletionProposal(text, documentOffset
                - qlen, qlen, cursor, null, text, contextInfo, text
                + "-Monitored variable declared in contract. "
                + var.getDataType());

            // and add to result list
            propList.add(proposal);
          }
        }

        for (IVariable var : model.getContract().getControlledVariables())
        {

          String text = var.getName();
          if (qualifier.proposal.toString().trim().length() == 0
              || text.startsWith(qualifier.proposal.toString()))
          {
            // Derive cursor position
            int cursor = text.length();

            IContextInformation contextInfo = new ContextInformation(null, text);
            // Construct proposal
            CompletionProposal proposal = new CompletionProposal(text, documentOffset
                - qlen, qlen, cursor, null, text, contextInfo, text
                + "-Monitored variable declared in contract. "
                + var.getDataType());

            // and add to result list
            propList.add(proposal);
          }
        }

      }
    }

    if (qualifier.postEqual && !qualifier.dot)
    {
      for (String text : vdmMetadata.keySet())
      {
        if (qualifier.proposal.toString().trim().length() == 0
            || text.startsWith(qualifier.proposal.toString()))
        {
          int cursor = text.length();
          IContextInformation contextInfo = new ContextInformation(null, text);
          // Construct proposal
          CompletionProposal proposal = new CompletionProposal(text, documentOffset
              - qlen, qlen, cursor, null, text, contextInfo, text
              + "-instance variable in System");
          // and add to result list
View Full Code Here

          || text.startsWith(qualifier.proposal.toString()))
      {
        // Derive cursor position
        int cursor = text.length();

        IContextInformation contextInfo = new ContextInformation(null, text);
        // Construct proposal
        CompletionProposal proposal = new CompletionProposal(text, documentOffset
            - qlen, qlen, cursor, null, text, contextInfo, text
            + "-Event declared in contract");
View Full Code Here

      int offset)
  {
    System.out.println("computeContextInformation");
    IContextInformation[] result = new IContextInformation[5];
    for (int i = 0; i < result.length; i++)
      result[i] = new ContextInformation(MessageFormat.format("private", new Object[] {
          Integer.valueOf(i), Integer.valueOf(offset) }), MessageFormat.format("private", new Object[] {
          Integer.valueOf(i), Integer.valueOf(offset - 5),
           Integer.valueOf(offset + 5) }));
    return result;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.contentassist.ContextInformation

Copyright © 2018 www.massapicom. 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.