Beispiel #1
0
  public static EditorMode getByExtension(String extension) {
    for (EditorMode mode : EditorMode.values()) {
      if (Arrays.binarySearch(mode.extensions, extension) >= 0) {
        return mode;
      }
    }

    return DEFAULT_MODE;
  }
Beispiel #2
0
  @Override
  public void setText(
      final String text,
      final EditorMode mode,
      final boolean readOnly,
      final boolean breakpointsEnabled,
      final int row) {
    this.text = text;
    this.mode = mode.getName();

    String orionMode = ORION_MODES.get(this.mode);
    if (orionMode != null) {
      this.mode = orionMode;
    }
    this.readOnly = readOnly;
    this.breakpointsEnabled = breakpointsEnabled;
    this.row = row;
    if (loaded) {
      updateWidgetContents();
    }
  }