Skip to content

Commit 4744d3e

Browse files
committed
[INTERNAL] code cleanup, wording, readme & version update
1 parent 45276bf commit 4744d3e

File tree

12 files changed

+54
-47
lines changed

12 files changed

+54
-47
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.14.0
2+
3+
NEW: Predefined column colors (Rainbow-style)
4+
NEW: Enhanced color scheme switch
5+
NEW: Table Editor coloring
6+
17
2.13.0
28
Jul 20, 2020
39

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ Please note:
155155

156156
Enable zero-based column numbering. This affects the tooltip info of the text editor as well as column numbering of the table editor.
157157

158+
##### Value coloring
159+
160+
Choose the coloring method of values. Possible options are:
161+
162+
- _Rainbow (Column Color)_ - values are colored based on their column.
163+
- _Simple (Text Color)_ - values are colored based on the defined text color.
164+
165+
All colors can be adjusted via [CSV Color Scheme](#color-scheme) settings.
166+
158167
#### Text Editor
159168

160169
##### Highlighting
@@ -163,10 +172,6 @@ Enable zero-based column numbering. This affects the tooltip info of the text ed
163172

164173
The highlighting of the current caret row might interfere with custom background color settings and can be enabled/disabled for CSV/TSV/PSV files here.
165174

166-
###### Enable column highlighting
167-
168-
An easy way to switch *Column Highlighting* on or off (in text editor).
169-
170175
###### Highlight tab separator
171176

172177
Enable/disable highlighting (and choose the highlight color) of tab characters (↹) in their role as value separator (TSV). Tabs as part of a value are therefore not highlighted on purpose.
@@ -205,7 +210,7 @@ The maximum width of a single table column in _px_, which is used when adjusting
205210

206211
If selected, the table column widths are adjusted based on the column contents automatically when the table editor is opened. This setting can be changed in the table editor itself per file.
207212

208-
##### Keep/ignore linebreak at end of file
213+
##### Keep/ignore linebreak at file end
209214

210215
If the file ends with a completely empty line (no spaces or tabs either), the table editor will not show this line as empty values but ignore it. When table data is serialized, an existing empty line is kept at the end of the file.
211216

@@ -217,23 +222,22 @@ Enables/disables the info panel at the bottom of the table editor.
217222

218223
Always quotes a single value on save - even if not required.
219224

220-
##### Enable column highlighting
221-
222-
An easy way to switch *Column Highlighting* on or off (in table editor).
223-
224225
### Color Scheme
225226

226-
The different symbols of a CSV document, namely the separator (comma), the quotes, the escaped literals and the text elements itself, are highlighted by a coloring scheme that can be customized:
227+
The different symbols of a CSV document, namely the *separator* (e.g. comma, pipe, semicolon), the *quote* character, the *escaped literals* and the *text* elements itself, are colored based on the CSV color scheme settings:
227228

228-
- _File > Settings > Editor > Color Scheme > CSV_
229+
- _File > Settings > Editor > Color Scheme > CSV/TSV/PSV_
229230

230231
Preset colors are based on Jetbrains IDE defaults and support the different UI themes.
231232

232233
![Color scheme settings](./docs/colorsettings.png)
233234

234-
#### Column Highlighting Colors
235+
#### Column Colors
236+
237+
Besides the colors and font-style variants for the different CSV symbols, additionally up to 10 different column colors can be defined.
238+
Those colors are applied to the columns round robin.
239+
Column colors are taken into account when **Rainbow** is selected as [**Value Coloring**](#value-coloring) option in the [Editor Settings](#editor-settings).
235240

236-
Besides defining colors and font-style variants for the different CSV symbols, additionally up to 10 different column highlight colors can be defined. Those colors are applied to the columns round robin. Undefined column highlight colors will be skipped if they are not followed by any other color definition.
237241

238242
### Formatting
239243

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jacocoTestReport {
2424
}
2525

2626
group 'net.seesharpsoft.intellij.plugins'
27-
version '2.13.0'
27+
version '2.14.0'
2828

2929
apply plugin: 'java'
3030
sourceCompatibility = javaVersion

docs/colorsettings.png

-3.6 KB
Loading

docs/example.png

-3.19 KB
Loading

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ protected static String getChangeNotes() {
3131
return getPluginDescriptor().getChangeNotes();
3232
}
3333

34-
private static final String SETTINGS_URL = "#Settings";
35-
3634
private static void openLink(Project project, String link) {
3735
if (!project.isDisposed() && link.startsWith("#")) {
3836
((ShowSettingsUtilImpl)ShowSettingsUtil.getInstance()).showSettingsDialog(project, link.substring(1), null);

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/CsvAnnotator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void annotate(@NotNull final PsiElement element, @NotNull final Annotatio
6767

6868
Annotation annotation = holder.createAnnotation(CSV_COLUMN_INFO_SEVERITY, textRange, message, tooltip);
6969
annotation.setEnforcedTextAttributes(
70-
CsvEditorSettings.getInstance().getColumnColoring() == CsvEditorSettings.ColumnColoring.RAINBOW ?
70+
CsvEditorSettings.getInstance().getValueColoring() == CsvEditorSettings.ValueColoring.RAINBOW ?
7171
CsvColorSettings.getTextAttributesOfColumn(columnInfo.getColumnIndex(), holder.getCurrentAnnotationSession()) :
7272
null
7373
);

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvColorSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class CsvColorSettings implements ColorSettingsPage {
4242
for (int i = 0; i < MAX_COLUMN_COLORING_COLORS; ++i) {
4343
TextAttributesKey textAttributesKey = createTextAttributesKey(String.format("CSV_PLUGIN_COLUMN_COLORING_ATTRIBUTE_%d", i + 1), CsvSyntaxHighlighter.TEXT);
4444
COLUMN_COLORING_ATTRIBUTES.add(textAttributesKey);
45-
attributesDescriptors.add(new AttributesDescriptor(String.format("Rainbow Coloring %d", i + 1), textAttributesKey));
45+
attributesDescriptors.add(new AttributesDescriptor(String.format("Column Color %d", i + 1), textAttributesKey));
4646
}
4747
DESCRIPTORS = attributesDescriptors.toArray(new AttributesDescriptor[attributesDescriptors.size()]);
4848
}
@@ -53,15 +53,15 @@ public static TextAttributes getTextAttributesOfColumn(int columnIndex, UserData
5353
EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
5454
textAttributeList = new ArrayList<>();
5555
int maxIndex = 0;
56-
switch(CsvEditorSettings.getInstance().getColumnColoring()) {
56+
switch(CsvEditorSettings.getInstance().getValueColoring()) {
5757
case RAINBOW:
5858
maxIndex = applyColumnTextAttributes(editorColorsScheme, textAttributeList);
5959
break;
6060
case SIMPLE:
6161
textAttributeList.add(editorColorsScheme.getAttributes(CsvSyntaxHighlighter.TEXT));
6262
break;
6363
default:
64-
throw new UnhandledSwitchCaseException(CsvEditorSettings.getInstance().getColumnColoring());
64+
throw new UnhandledSwitchCaseException(CsvEditorSettings.getInstance().getValueColoring());
6565
}
6666
textAttributeList = textAttributeList.subList(0, maxIndex + 1);
6767
userDataHolder.putUserData(COLUMN_COLORING_TEXT_ATTRIBUTES_KEY, textAttributeList);

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ public enum EditorPrio {
4040
TEXT_ONLY
4141
}
4242

43-
public enum ColumnColoring {
44-
RAINBOW("Rainbow (colorful columns)"),
45-
SIMPLE("Simple (single text color)");
43+
public enum ValueColoring {
44+
RAINBOW("Rainbow (Column Color)"),
45+
SIMPLE("Simple (Text Color)");
4646

4747
private final String display;
4848

49-
ColumnColoring(String displayArg) {
49+
ValueColoring(String displayArg) {
5050
this.display = displayArg;
5151
}
5252

@@ -79,7 +79,7 @@ public static final class OptionSet {
7979
public CsvValueSeparator DEFAULT_VALUE_SEPARATOR = VALUE_SEPARATOR_DEFAULT;
8080
public boolean KEEP_TRAILING_SPACES = false;
8181
public String COMMENT_INDICATOR = COMMENT_INDICATOR_DEFAULT;
82-
public ColumnColoring COLUMN_COLORING = ColumnColoring.RAINBOW;
82+
public ValueColoring VALUE_COLORING = ValueColoring.RAINBOW;
8383

8484
public OptionSet() {
8585
EditorSettingsExternalizable editorSettingsExternalizable = EditorSettingsExternalizable.getInstance();
@@ -285,20 +285,19 @@ public String getCommentIndicator() {
285285
return getState().COMMENT_INDICATOR;
286286
}
287287

288-
public ColumnColoring getColumnColoring() {
289-
return getState().COLUMN_COLORING;
288+
public ValueColoring getValueColoring() {
289+
return getState().VALUE_COLORING;
290290
}
291291

292-
public void setColumnColoring(ColumnColoring columnColoring) {
293-
getState().COLUMN_COLORING = columnColoring;
292+
public void setValueColoring(ValueColoring valueColoring) {
293+
getState().VALUE_COLORING = valueColoring;
294294
}
295295

296296
public boolean checkCurrentPluginVersion(String actualVersion) {
297-
return false;
298-
// if (!actualVersion.equals(getState().CURRENT_PLUGIN_VERSION)) {
299-
// getState().CURRENT_PLUGIN_VERSION = actualVersion;
300-
// return false;
301-
// }
302-
// return true;
297+
if (!actualVersion.equals(getState().CURRENT_PLUGIN_VERSION)) {
298+
getState().CURRENT_PLUGIN_VERSION = actualVersion;
299+
return false;
300+
}
301+
return true;
303302
}
304303
}

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProvider.form

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
380380
</constraints>
381381
<properties>
382-
<text value="Line comment indicator (e.g. # or //):"/>
382+
<text value="Line comment indicator:"/>
383383
</properties>
384384
</component>
385385
<component id="a30e" class="javax.swing.JTextField" binding="tfCommentIndicator">
@@ -410,10 +410,10 @@
410410
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
411411
</constraints>
412412
<properties>
413-
<text value="Column Coloring:"/>
413+
<text value="Value Coloring:"/>
414414
</properties>
415415
</component>
416-
<component id="2e9e9" class="javax.swing.JComboBox" binding="comboColumnColoring" custom-create="true">
416+
<component id="2e9e9" class="javax.swing.JComboBox" binding="comboValueColoring" custom-create="true">
417417
<constraints>
418418
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
419419
</constraints>

0 commit comments

Comments
 (0)