// Path: src/com/equadon/intellij/mips/icons/MipsIcons.java
// public interface MipsIcons {
//   Icon FILE = IconLoader.getIcon("/icons/mips-file-16.png");
//   Icon LABEL = IconLoader.getIcon("/icons/mips-label-16.png");
//   Icon DIRECTIVE = IconLoader.getIcon("/icons/mips-directive-16.png");
//   Icon INSTRUCTION = IconLoader.getIcon("/icons/mips-instruction-16.png");
// }
// 
// Path: src/com/equadon/intellij/mips/editor/MipsSyntaxHighlighter.java
// public class MipsSyntaxHighlighter extends SyntaxHighlighterBase {
//   public static final TextAttributesKey ERROR = TextAttributesKey.createTextAttributesKey("MIPS_ERROR", DefaultLanguageHighlighterColors.INVALID_STRING_ESCAPE);
// 
//   public static final TextAttributesKey COMMENT = TextAttributesKey.createTextAttributesKey("MIPS_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT);
// 
//   public static final TextAttributesKey OPERATOR = TextAttributesKey.createTextAttributesKey("MIPS_OPERATOR", DefaultLanguageHighlighterColors.KEYWORD);
//   public static final TextAttributesKey DIRECTIVE = TextAttributesKey.createTextAttributesKey("MIPS_DIRECTIVE", DefaultLanguageHighlighterColors.STATIC_FIELD);
//   public static final TextAttributesKey LABEL = TextAttributesKey.createTextAttributesKey("MIPS_LABEL", DefaultLanguageHighlighterColors.IDENTIFIER);
//   public static final TextAttributesKey MAIN_LABEL = TextAttributesKey.createTextAttributesKey("MIPS_MAIN_LABEL", DefaultLanguageHighlighterColors.STATIC_METHOD);
// 
//   public static final TextAttributesKey STRING = TextAttributesKey.createTextAttributesKey("MIPS_STRING", DefaultLanguageHighlighterColors.STRING);
//   public static final TextAttributesKey NUMBER = TextAttributesKey.createTextAttributesKey("MIPS_NUMBER", DefaultLanguageHighlighterColors.NUMBER);
//   public static final TextAttributesKey REGISTER = TextAttributesKey.createTextAttributesKey("MIPS_REGISTER", DefaultLanguageHighlighterColors.INSTANCE_FIELD);
// 
//   @NotNull
//   @Override
//   public Lexer getHighlightingLexer() {
//     return new MipsLexerAdapter();
//   }
// 
//   @NotNull
//   @Override
//   public TextAttributesKey[] getTokenHighlights(IElementType type) {
//     if (type == TokenType.BAD_CHARACTER)
//       return pack(ERROR);
//     if (MipsTokenTypes.COMMENTS.contains(type))
//       return pack(COMMENT);
//     if (type == MipsElementTypes.OPERATOR)
//       return pack(OPERATOR);
//     if (type == MipsElementTypes.DIRECTIVE)
//       return pack(DIRECTIVE);
//     if (type == MipsElementTypes.IDENTIFIER)
//       return pack(LABEL);
//     if (MipsTokenTypes.STRINGS.contains(type))
//       return pack(STRING);
//     if (MipsTokenTypes.NUMBERS.contains(type))
//       return pack(NUMBER);
//     if (MipsTokenTypes.REGISTERS.contains(type))
//       return pack(REGISTER);
// 
//     return EMPTY;
//   }
// }


import static com.equadon.intellij.mips.editor.MipsSyntaxHighlighter.*;
import com.equadon.intellij.mips.icons.MipsIcons;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.options.colors.AttributesDescriptor;
import com.intellij.openapi.options.colors.ColorDescriptor;
import com.intellij.openapi.options.colors.ColorSettingsPage;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import javax.swing.*;
/*
 * Copyright 2017 Niklas Persson
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.equadon.intellij.mips.editor;






public class MipsColorSettingsPage implements ColorSettingsPage {
  private static final AttributesDescriptor[] ATTRIBUTES = new AttributesDescriptor[] {
    new AttributesDescriptor("Illegal character", ERROR),
    new AttributesDescriptor("Comment", COMMENT),
    new AttributesDescriptor("String", STRING),
    new AttributesDescriptor("Number", NUMBER),
    new AttributesDescriptor("Register", REGISTER),
    new AttributesDescriptor("Operator", OPERATOR),
    new AttributesDescriptor("Directive", DIRECTIVE),
    new AttributesDescriptor("Label", LABEL),
  };

  private static Map<String, TextAttributesKey> ATTRIBUTES_KEY_MAP = ContainerUtil.newHashMap();

  static {
    ATTRIBUTES_KEY_MAP.put("d", DIRECTIVE);
    ATTRIBUTES_KEY_MAP.put("l", LABEL);
    ATTRIBUTES_KEY_MAP.put("o", OPERATOR);
  }

  @Nullable
  @Override
  public Icon getIcon() {
// Path: src/com/equadon/intellij/mips/icons/MipsIcons.java
// public interface MipsIcons {
//   Icon FILE = IconLoader.getIcon("/icons/mips-file-16.png");
//   Icon LABEL = IconLoader.getIcon("/icons/mips-label-16.png");
//   Icon DIRECTIVE = IconLoader.getIcon("/icons/mips-directive-16.png");
//   Icon INSTRUCTION = IconLoader.getIcon("/icons/mips-instruction-16.png");
// }
// 
// Path: src/com/equadon/intellij/mips/editor/MipsSyntaxHighlighter.java
// public class MipsSyntaxHighlighter extends SyntaxHighlighterBase {
//   public static final TextAttributesKey ERROR = TextAttributesKey.createTextAttributesKey("MIPS_ERROR", DefaultLanguageHighlighterColors.INVALID_STRING_ESCAPE);
// 
//   public static final TextAttributesKey COMMENT = TextAttributesKey.createTextAttributesKey("MIPS_COMMENT", DefaultLanguageHighlighterColors.LINE_COMMENT);
// 
//   public static final TextAttributesKey OPERATOR = TextAttributesKey.createTextAttributesKey("MIPS_OPERATOR", DefaultLanguageHighlighterColors.KEYWORD);
//   public static final TextAttributesKey DIRECTIVE = TextAttributesKey.createTextAttributesKey("MIPS_DIRECTIVE", DefaultLanguageHighlighterColors.STATIC_FIELD);
//   public static final TextAttributesKey LABEL = TextAttributesKey.createTextAttributesKey("MIPS_LABEL", DefaultLanguageHighlighterColors.IDENTIFIER);
//   public static final TextAttributesKey MAIN_LABEL = TextAttributesKey.createTextAttributesKey("MIPS_MAIN_LABEL", DefaultLanguageHighlighterColors.STATIC_METHOD);
// 
//   public static final TextAttributesKey STRING = TextAttributesKey.createTextAttributesKey("MIPS_STRING", DefaultLanguageHighlighterColors.STRING);
//   public static final TextAttributesKey NUMBER = TextAttributesKey.createTextAttributesKey("MIPS_NUMBER", DefaultLanguageHighlighterColors.NUMBER);
//   public static final TextAttributesKey REGISTER = TextAttributesKey.createTextAttributesKey("MIPS_REGISTER", DefaultLanguageHighlighterColors.INSTANCE_FIELD);
// 
//   @NotNull
//   @Override
//   public Lexer getHighlightingLexer() {
//     return new MipsLexerAdapter();
//   }
// 
//   @NotNull
//   @Override
//   public TextAttributesKey[] getTokenHighlights(IElementType type) {
//     if (type == TokenType.BAD_CHARACTER)
//       return pack(ERROR);
//     if (MipsTokenTypes.COMMENTS.contains(type))
//       return pack(COMMENT);
//     if (type == MipsElementTypes.OPERATOR)
//       return pack(OPERATOR);
//     if (type == MipsElementTypes.DIRECTIVE)
//       return pack(DIRECTIVE);
//     if (type == MipsElementTypes.IDENTIFIER)
//       return pack(LABEL);
//     if (MipsTokenTypes.STRINGS.contains(type))
//       return pack(STRING);
//     if (MipsTokenTypes.NUMBERS.contains(type))
//       return pack(NUMBER);
//     if (MipsTokenTypes.REGISTERS.contains(type))
//       return pack(REGISTER);
// 
//     return EMPTY;
//   }
// }


// Path: src/com/equadon/intellij/mips/editor/MipsColorSettingsPage.java
import static com.equadon.intellij.mips.editor.MipsSyntaxHighlighter.*;
import com.equadon.intellij.mips.icons.MipsIcons;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.options.colors.AttributesDescriptor;
import com.intellij.openapi.options.colors.ColorDescriptor;
import com.intellij.openapi.options.colors.ColorSettingsPage;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import javax.swing.*;

/*
 * Copyright 2017 Niklas Persson
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.equadon.intellij.mips.editor;






public class MipsColorSettingsPage implements ColorSettingsPage {
  private static final AttributesDescriptor[] ATTRIBUTES = new AttributesDescriptor[] {
    new AttributesDescriptor("Illegal character", ERROR),
    new AttributesDescriptor("Comment", COMMENT),
    new AttributesDescriptor("String", STRING),
    new AttributesDescriptor("Number", NUMBER),
    new AttributesDescriptor("Register", REGISTER),
    new AttributesDescriptor("Operator", OPERATOR),
    new AttributesDescriptor("Directive", DIRECTIVE),
    new AttributesDescriptor("Label", LABEL),
  };

  private static Map<String, TextAttributesKey> ATTRIBUTES_KEY_MAP = ContainerUtil.newHashMap();

  static {
    ATTRIBUTES_KEY_MAP.put("d", DIRECTIVE);
    ATTRIBUTES_KEY_MAP.put("l", LABEL);
    ATTRIBUTES_KEY_MAP.put("o", OPERATOR);
  }

  @Nullable
  @Override
  public Icon getIcon() {
    return MipsIcons.FILE;