Package org.eclipse.jface.text.rules

Examples of org.eclipse.jface.text.rules.IRule


    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    // Add a rule for single quotes
    rules.add(new SingleLineRule("'", "'", string, '\\'));
    // Add generic whitespace rule.
    rules.add(new WhitespaceRule(new WhitespaceDetector()));
        rules.add(new IRule() {
            public IToken evaluate(final ICharacterScanner scanner) {
                int c = scanner.read();
                if( '$' == c ) {
                  c = scanner.read();
                  if( c == '{') {
View Full Code Here


        // We can't reliably use rulePosition here because it might be
        // null ...
        int tokenOffset = scanner.getTokenOffset();
        int tokenLength = scanner.getTokenLength();
        IRule rule = (rulePosition == null) ? null : rulePosition.getRule();
        // If you make a completion request in the middle of whitespace,
        // we don't want to select the whitespace, so zero out the
        // whitespace token offsets.
        if (rule instanceof WhitespaceRule) {
          int partialOffset = (offset - tokenOffset);
View Full Code Here

        if (editorInput instanceof FileEditorInput) {
          IFile file = ((FileEditorInput) editorInput).getFile();
          project = file.getProject();
        }

        IRule rule = rulePosition.getRule();
        if (rule instanceof ElementTypeRule) {
          String elementTypeName = rulePosition.getText();
          ComponentLocateScope componentLocateScope = new ComponentLocateScope(project, elementTypeName, true);
          LocalizedComponentsLocateResult localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
          Locate locate = new Locate(componentLocateScope, localizedComponentsLocateResult);
View Full Code Here

  public RulePosition nextRulePosition() {
    fTokenOffset = fOffset;
    fColumn = UNDEFINED;

    IRule matchingRule = null;
    if (fRules != null) {
      for (int i = 0; matchingRule == null && i < fRules.length; i++) {
        IToken token = fRules[i].evaluate(this);
        if (!token.isUndefined()) {
          matchingRule = fRules[i];
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.rules.IRule

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.