Examples of IContextInformation


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

      String type = dp.getPartition(documentOffset).getType();
      if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
        // get context info from completion results...
        ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset);
        for (int i = 0; i < proposals.length; i++) {
          IContextInformation ci = proposals[i].getContextInformation();
          if (ci != null)
            results.add(ci);
        }
      }
    }
View Full Code Here

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

      String type = dp.getPartition(documentOffset).getType();
      if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
        // get context info from completion results...
        List proposals = computeCompletionProposals(context,monitor);
        for (int i = 0; i < proposals.size(); i++) {
          IContextInformation ci = ((ICompletionProposal)proposals.get(i)).getContextInformation();
          if (ci != null)
            results.add(ci);
        }
      }
    }
View Full Code Here

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

    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // don't do this, it's slow
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
View Full Code Here

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

    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
   
    /* the context information is calculated with respect to the java document
     * thus it needs to be updated in respect of the JSP document.
     */
 
View Full Code Here

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

      if(fistSpaceIndex != -1) {
        shortDisplayString = longDisplayString.substring(fistSpaceIndex);
      }
       
      String displayString = completion + " " + shortDisplayString; //$NON-NLS-1$
      IContextInformation contextInformation = javaProposal.getContextInformation();
      String additionalInfo = javaProposal.getAdditionalProposalInfo();
      int relevance = javaProposal.getRelevance();
     
      boolean updateLengthOnValidate = true;
     
View Full Code Here

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

              || 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

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

          || 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

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

      fContextSelectorTable.setRedraw(false);
      fContextSelectorTable.removeAll();

      TableItem item;
      IContextInformation t;
      for (int i= 0; i < contexts.length; i++) {
        t= contexts[i];
        item= new TableItem(fContextSelectorTable, SWT.NULL);
        if (t.getImage() != null)
          item.setImage(t.getImage());
        item.setText(t.getContextDisplayString());
      }

      fContextSelectorTable.select(0);
      fContextSelectorTable.setRedraw(true);
    }
View Full Code Here

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

      if (selection != null) {
        fViewer.setSelectedRange(selection.x, selection.y);
        fViewer.revealRange(selection.x, selection.y);
      }

      IContextInformation info= p.getContextInformation();
      if (info != null) {

        int position;
        if (p instanceof ICompletionProposalExtension) {
          ICompletionProposalExtension e= (ICompletionProposalExtension) p;
View Full Code Here

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

    private List addContextInformations(ITextViewer viewer, int offset) {
        ICompletionProposal[] proposals= internalComputeCompletionProposals(viewer, offset);

        List result= new ArrayList();
        for (int i= 0; i < proposals.length; i++) {
            IContextInformation contextInformation= proposals[i].getContextInformation();
            if (contextInformation != null) {
                ContextInformationWrapper wrapper= new ContextInformationWrapper(contextInformation);
                wrapper.setContextInformationPosition(offset);
                result.add(wrapper);
            }
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.