private TextStyle getSelectionStyle(TextStyle style) { TextStyle selectionStyle = style.clone(); if (mySettingsProvider.useInverseSelectionColor()) { selectionStyle = getInversedStyle(style); } else { TextStyle mySelectionStyle = mySettingsProvider.getSelectionColor(); selectionStyle.setBackground(mySelectionStyle.getBackground()); selectionStyle.setForeground(mySelectionStyle.getForeground()); } return selectionStyle; }
private TextStyle getInversedStyle(TextStyle style) { TextStyle selectionStyle; selectionStyle = style.clone(); selectionStyle.setOption(Option.INVERSE, !selectionStyle.hasOption(Option.INVERSE)); if (selectionStyle.getForeground() == null) { selectionStyle.setForeground(myStyleState.getForeground()); } if (selectionStyle.getBackground() == null) { selectionStyle.setBackground(myStyleState.getBackground()); } return selectionStyle; }