當前位置: 首頁>>代碼示例>>Java>>正文


Java IWhitespaceDetector類代碼示例

本文整理匯總了Java中org.eclipse.jface.text.rules.IWhitespaceDetector的典型用法代碼示例。如果您正苦於以下問題:Java IWhitespaceDetector類的具體用法?Java IWhitespaceDetector怎麽用?Java IWhitespaceDetector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IWhitespaceDetector類屬於org.eclipse.jface.text.rules包,在下文中一共展示了IWhitespaceDetector類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MDScanner

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
public MDScanner(ColorManager cm) {
this.cm = cm;      
Token heading = new Token(new TextAttribute(cm.getColor(MDColorConstants.HEADER), null, SWT.BOLD));
   Token comment = new Token(new TextAttribute(cm.getColor(MDColorConstants.COMMENT)));
   Token emphasis = new Token(new TextAttribute(cm.getColor(MDColorConstants.DEFAULT), null, SWT.ITALIC));
   setRules(new IRule[] {           
      new HeaderRule(heading),
      new EmphasisRule("_", emphasis),
      new EmphasisRule("***", emphasis),
      new EmphasisRule("**", emphasis),
      new EmphasisRule("*", emphasis),
      new MultiLineRule("<!--", "-->", comment),
      new WhitespaceRule(new IWhitespaceDetector() {
         public boolean isWhitespace(char c) {
            return Character.isWhitespace(c);
         }
      }),
   });
}
 
開發者ID:shvenkat,項目名稱:Eclipse-Markdown-Editor-Plugin,代碼行數:20,代碼來源:MDScanner.java

示例2: SQLKeywordScanner

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
/**
 *  
 */
public SQLKeywordScanner( )
{
	super( );
	IToken sqlKeywordsToken = new Token( new TextAttribute( ColorManager.getColor(127, 0, 85), null, SWT.BOLD ) );
	ArrayList rules = new ArrayList( );
	rules.add( new SQLKeywordRule( sqlKeywordsToken, reservedwords ) );
	rules.add( new SQLKeywordRule( sqlKeywordsToken, types ) );
	rules.add( new SQLKeywordRule( sqlKeywordsToken, constants ) );
	rules.add( new SQLKeywordRule( sqlKeywordsToken, functions ) );
	rules.add( new SQLKeywordRule( sqlKeywordsToken, predicates ) );
	
	// Add generic whitespace rule.
	rules.add( new WhitespaceRule( new IWhitespaceDetector( ) {

		public boolean isWhitespace( char c )
		{
			return Character.isWhitespace( c );
		}
	} ) );

	setRules( (IRule[]) rules.toArray( new IRule[rules.size( )] ) );
	this.setDefaultReturnToken( new Token( new TextAttribute( Display.getDefault( ).getSystemColor( SWT.COLOR_LIST_FOREGROUND ))));
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:SQLKeywordScanner.java

示例3: JSScanner

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
/**
 * Creates a new JSScanner object.
 * 
 */
public JSScanner( )
{
	List rules = new ArrayList( );

	// Add generic whitespace rule.
	rules.add( new WhitespaceRule( new IWhitespaceDetector( ) {

		public boolean isWhitespace( char c )
		{
			return Character.isWhitespace( c );
		}
	} ) );

	IRule[] result = new IRule[rules.size( )];
	rules.toArray( result );
	setRules( result );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:22,代碼來源:JSScanner.java

示例4: RelBoundScanner

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
public RelBoundScanner(final ColorManager manager) {
  final IToken token = new Token(new TextAttribute(manager.getColor(IColorConstants.REL_BOUND)));
  final IToken bracketsToken =
      new Token(new TextAttribute(manager.getColor(IColorConstants.REL_BOUND_BRACKETS)));
  final IToken commentToken =
      new Token(new TextAttribute(manager.getColor(IColorConstants.COMMENT)));

  final List<IRule> rules = new ArrayList<IRule>();

  rules.add(new MultiLineRule("/**", "**/", commentToken));
  rules.add(new EndOfLineRule("--", commentToken));
  // rules.add(new EndOfLineRule("//", commentToken));
  rules.add(new BracketsRule(bracketsToken));

  rules.add(new WhitespaceRule(new IWhitespaceDetector() {

    @Override
    public boolean isWhitespace(final char c) {
      return Character.isWhitespace(c);
    }
  }));
  this.setDefaultReturnToken(token);

  final IRule[] result = new IRule[rules.size()];
  rules.toArray(result);
  this.setRules(result);
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:28,代碼來源:RelBoundScanner.java

示例5: createRules

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
/**
 * Use the default Eclipse higlighting scheme.
 */
private void createRules() {
    Token keywordToken = new Token(keywordAttribute);
    Token commentToken = new Token(commentAttribute);
    Token docToken = new Token(docAttribute);
    Token stringToken = new Token(stringAttribute);
    Token numberToken = new Token(numberAttribute);
    Token normalToken = new Token(normalAttribute);

    setDefaultReturnToken(normalToken);

    setRules(new IRule[] { new EndOfLineRule("//", commentToken),//$NON-NLS-2$
            new KeywordRule(keywordToken),//$NON-NLS-2$
            new MultiLineRule("/**", "*/", docToken, (char) 0, false), //$NON-NLS-2$
            new MultiLineRule("/*", "*/", commentToken, (char) 0, false), //$NON-NLS-2$
            new SingleLineRule("\"", "\"", stringToken, '\\'), //$NON-NLS-2$
            // Regexp
            new SingleLineRule("/", "/", stringToken, '\\'), //$NON-NLS-2$
            new SingleLineRule("'", "'", stringToken, '\\'), //$NON-NLS-2$
            new WhitespaceRule(new IWhitespaceDetector() {
                public boolean isWhitespace(char c) {
                    return Character.isWhitespace(c);
                }
            }),//$NON-NLS-2$
            new WordRule(new WordDetector(), normalToken),//$NON-NLS-2$
            new NumberRule(numberToken) });
}
 
開發者ID:Nodeclipse,項目名稱:GradleEditor,代碼行數:30,代碼來源:GradleCodeScanner.java

示例6: GlslScanner

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
public GlslScanner() {
	Activator plugin = Activator.getDefault();
	final WordRule wordRule = GlslScanners.createWordRule();
	
	final Token keywordToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.KEYWORD_COLOR), null, SWT.BOLD));
	final Token typeToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.TYPE_COLOR)));
	final Token qualifierToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.QUALIFIER_COLOR), null, SWT.BOLD));
	final Token functionToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.FUNCTION_COLOR)));
	final Token builtInVariableToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.BUILT_IN_VARIABLES_COLOR)));
	final Token commentToken = new Token(new TextAttribute(plugin.getColor(GlslEditor.COMMENTS_COLOR)));
	
	List<IRule> rules = new ArrayList<>();

	// Rules which affect entire lines at once
	rules.add(new SingleLineRule("//", null, commentToken, '\0', true, false));
	
	// Rules which don't affect entire lines
	rules.add(new SingleLineRule("/*", "*/", commentToken));
	rules.add(wordRule);
	
	GlslScanners.addToWordRule(wordRule, Glsl.KEYWORDS, keywordToken);
	GlslScanners.addToWordRule(wordRule, Glsl.TYPES, typeToken);
	GlslScanners.addToWordRule(wordRule, Glsl.QUALIFIERS, qualifierToken);
	GlslScanners.addToWordRule(wordRule, Glsl.FUNCTIONS, functionToken);
	GlslScanners.addToWordRule(wordRule, Glsl.VARIABLES, builtInVariableToken);
	
	rules.add(new WhitespaceRule(new IWhitespaceDetector() {
		@Override
		public boolean isWhitespace(char c) {
		   return Character.isWhitespace(c);
		}
       }));
	
	IRule[] rulesArray = new IRule[rules.size()];
	for (int i = 0; i < rulesArray.length; i++) {
		rulesArray[i] = rules.get(i);
	}
	
	setRules(rulesArray);
}
 
開發者ID:Johnnei,項目名稱:GLSL-Eclipse,代碼行數:41,代碼來源:GlslScanner.java

示例7: createRules

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
/**
 * Use the default Eclipse higlighting scheme.
 */
private void createRules() {
  Token keywordToken = new Token(
      new TextAttribute(EditorColors.getColor(new RGB(127, 0, 85)), null, SWT.BOLD));

  commentToken = new Token(commentAttribute);

  Token jsDocToken = new Token(jsDocAttribute);

  Token stringToken = new Token(
      new TextAttribute(EditorColors.getColor(new RGB(42, 0, 255)), null, SWT.NORMAL));

  RGB blackRgb = new RGB(0, 0, 0);

  Token numberToken = new Token(
      new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));

  Token normalToken = new Token(
      new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));
  setDefaultReturnToken(normalToken);

  setRules(new IRule[] {
      new EndOfLineRule("//", commentToken), //$NON-NLS-1$
      new KeywordRule(keywordToken),
      new MultiLineRule("/**", "*/", jsDocToken, (char) 0, false),  //$NON-NLS-1$ //$NON-NLS-2$
      new MultiLineRule("/*", "*/", commentToken, (char) 0, false),  //$NON-NLS-1$ //$NON-NLS-2$
      new SingleLineRule("\"", "\"", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
      // Regexp
      new SingleLineRule("/", "/", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
      new SingleLineRule("'", "'", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
      new WhitespaceRule(new IWhitespaceDetector() {
        public boolean isWhitespace(char c) {
          return Character.isWhitespace(c);
        }
      }),

      new WordRule(new WordDetector(), normalToken),
      new NumberRule(numberToken),
  });
}
 
開發者ID:jbosstools,項目名稱:chromedevtools,代碼行數:43,代碼來源:JsCodeScanner.java

示例8: createWhitespaceRule

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
private IRule createWhitespaceRule() {
	IWhitespaceDetector detector = new IWhitespaceDetector() {
		@Override
		public boolean isWhitespace(char c) {
			return Character.isWhitespace(c);
		}
	};
	return new WhitespaceRule(detector);
}
 
開發者ID:yinonavraham,項目名稱:myLOGO4Eclipse,代碼行數:10,代碼來源:LogoScriptSourceViewerConfiguration.java

示例9: getDefaultWhitespaceDetector

import org.eclipse.jface.text.rules.IWhitespaceDetector; //導入依賴的package包/類
/**
 * Factory method for the whitespace detector
 */
public static IWhitespaceDetector getDefaultWhitespaceDetector()
{
    return new TLAWhitespaceDetector();
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:8,代碼來源:DocumentHelper.java


注:本文中的org.eclipse.jface.text.rules.IWhitespaceDetector類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。