Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
406 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvEscapeCharacter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.seesharpsoft.intellij.plugins.csv; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public enum CsvEscapeCharacter { | ||
QUOTE("\"", "Double Quote (\")"), | ||
BACKSLASH("\\", "Backslash (\\)"); | ||
|
||
private final String myCharacter; | ||
private final String myDisplay; | ||
private final Pattern myPattern; | ||
|
||
CsvEscapeCharacter(String character, String display) { | ||
myCharacter = character; | ||
myDisplay = display; | ||
myPattern = Pattern.compile(Pattern.quote(myCharacter + "\"")); | ||
} | ||
|
||
public String getCharacter() { | ||
return myCharacter; | ||
} | ||
|
||
public String getDisplay() { | ||
return myDisplay; | ||
} | ||
|
||
public boolean isEscapedQuote(String text) { | ||
return myPattern.matcher(text).matches(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvLexerAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package net.seesharpsoft.intellij.plugins.csv; | ||
|
||
import com.intellij.lexer.FlexAdapter; | ||
import net.seesharpsoft.intellij.plugins.csv.editor.CsvEditorSettings; | ||
|
||
public class CsvLexerAdapter extends FlexAdapter { | ||
public CsvLexerAdapter(String separator, CsvEditorSettings.EscapeCharacter escapeCharacter) { | ||
public CsvLexerAdapter(CsvValueSeparator separator, CsvEscapeCharacter escapeCharacter) { | ||
super(new CsvLexer(null, separator, escapeCharacter)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvParserUtil.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvSeparatorHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package net.seesharpsoft.intellij.plugins.csv; | ||
|
||
public interface CsvSeparatorHolder { | ||
String getSeparator(); | ||
CsvValueSeparator getSeparator(); | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvValueSeparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package net.seesharpsoft.intellij.plugins.csv; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public enum CsvValueSeparator { | ||
COMMA(",", "Comma (,)"), | ||
SEMICOLON(";", "Semicolon (;)"), | ||
PIPE("|", "Pipe (|)"), | ||
TAB("\t", "Tab (↹)"); | ||
|
||
private final String myCharacter; | ||
private final String myDisplay; | ||
private final Pattern myPattern; | ||
|
||
CsvValueSeparator(String character, String display) { | ||
myCharacter = character; | ||
myDisplay = display; | ||
myPattern = Pattern.compile(Pattern.quote(myCharacter)); | ||
} | ||
|
||
public String getCharacter() { | ||
return myCharacter; | ||
} | ||
|
||
public String getDisplay() { | ||
return myDisplay; | ||
} | ||
|
||
public boolean isValueSeparator(String text) { | ||
return myPattern.matcher(text).matches(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.