Package org.eclipse.jface.text.contentassist

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


    return false;
  }

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


          }
          String infoDisplayString = sb.toString();
          if (infoDisplayString.length() > 0) {
            infoDisplayString = infoDisplayString.substring(0,
                infoDisplayString.length() - 1);
            return new ContextInformation(displayString,
                infoDisplayString);
          }

        }
      } catch (ModelException e) {
        e.printStackTrace();
      }

    }

    String infoDisplayString = displayString;

    int i = infoDisplayString.indexOf('(');
    if (i != -1) {
      infoDisplayString = infoDisplayString.substring(i + 1);
    }
    i = infoDisplayString.indexOf(')');
    if (i != -1) {
      infoDisplayString = infoDisplayString.substring(0, i);
    }
    if (infoDisplayString.length() == 0) {
      return null;
    }
    return new ContextInformation(displayString, infoDisplayString);
  }
View Full Code Here

            //(Function)i.next();

            String usage = fun.toString();
            //System.err.println(usage);
           
            result[x] = new ContextInformation(
              CFPluginImages.get(CFPluginImages.ICON_FUNC),
              //info,
              usage,
              //""
              usage //fun.getHelp()
            );
            this.validator.install(result[x], viewer, documentOffset);
            x++;
        }
        //System.out.println(x);
        result[x] = new ContextInformation(
          "",
          ""
        );
       
        /*int i = 0;
View Full Code Here

      if (codeContext != null) {

        List<Node> units = codeContext.getCompletionsForString(line, prefix, linenumber);

        for (Node unit : units) {
          IContextInformation info = new ContextInformation(unit.getDocumentation(),
              unit.getDocumentation());

          int prefix_len = prefix.lastIndexOf('.');
          if (unit.getInsertionText() != null) {
            int len = unit.getInsertionText().length();
            if (len > 0) {
              results.add(new CompletionProposal(unit.getInsertionText(), offset, 0,
                  unit.getInsertionText().length() - 1, getImage(unit), unit.getName(), info,
                  unit.getDocumentation()));
            }
          }
        }
      } else {
        // The following is a simple place holder for a more complex
        // completion
        Keywords[] values = Keywords.values();
        for (int i = 0; i < values.length; i++) {
          String keyword = values[i].getValue();
          if (keyword.startsWith(prefix)) {
            IContextInformation info = new ContextInformation(keyword, "XXX");
            //MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
            results.add(new CompletionProposal(keyword.substring(prefix.length(), keyword.length())
                + " ", offset, 0, keyword.length() - prefix.length() + 1, go, keyword, info,
                values[i].getDescription()));
          }
View Full Code Here

     
      String spec = completionEntry.substring(secondComma + 2);
     
      String descriptiveString = identifier + " : " + spec;
      String description = codeContext.getDescriptionForName(identifier).trim();
      IContextInformation info = new ContextInformation(description, description);
      //MessageFormat.format(JavaEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
     
      Image image = GoPluginImages.SOURCE_OTHER.getImage();
      String substr = identifier.substring(prefix.length());
      int replacementLength = identifier.length() - prefix.length();
View Full Code Here

 
  /* Method declared on IContentAssistProcessor */
  public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
    IContextInformation[] result= new IContextInformation[5];
    for (int i= 0; i < result.length; i++)
      result[i]= new ContextInformation(
        MessageFormat.format("proposal {0} at position {1}", new Object[] { new Integer(i), new Integer(documentOffset) }),
        MessageFormat.format("proposal {0} valid from {1} to {2}", new Object[] { new Integer(i), new Integer(documentOffset - 5), new Integer(documentOffset + 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.