Exemple #1
0
 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;
 }
Exemple #2
0
 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;
 }