Package at.bestsolution.efxclipse.text.test.app.sample.jscanners

Source Code of at.bestsolution.efxclipse.text.test.app.sample.jscanners.TextAttributesManager

package at.bestsolution.efxclipse.text.test.app.sample.jscanners;

import java.util.HashMap;
import java.util.Map;

import at.bestsolution.efxclipse.styledtext.StyleRange;
import at.bestsolution.efxclipse.text.jface.TextAttribute;

import javafx.scene.paint.Color;
import javafx.scene.text.Font;

public class TextAttributesManager {
 
  private Map<String, TextAttribute> color = new HashMap<>();
 
  public void registerToken(String tokenKey, Color fgColor) {
    this.color.put(tokenKey, new TextAttribute(fgColor, null, StyleRange.NORMAL, null));
  }
 
  public void registerToken(String tokenKey, Color fgColor, Color bgColor, Font font) {
    this.color.put(tokenKey, new TextAttribute(fgColor, bgColor, StyleRange.NORMAL, font));
  }
 
  public void registerToken(String tokenKey, TextAttribute attribute) {
    this.color.put(tokenKey, attribute);
  }
 
  public TextAttribute getTokenAttribute(String tokenKey) {
    return this.color.get(tokenKey);
  }
}
TOP

Related Classes of at.bestsolution.efxclipse.text.test.app.sample.jscanners.TextAttributesManager

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.