Rename Whitespace enum to make the intent more clear
Change-Id: I591abfe195a9cb2baf3ac516c7874d28ef70f20e
This commit is contained in:
parent
dc53a1665b
commit
09caa54a0e
@ -1256,7 +1256,7 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
|
|||||||
{
|
{
|
||||||
"context": 10,
|
"context": 10,
|
||||||
"theme": "DEFAULT",
|
"theme": "DEFAULT",
|
||||||
"ignore_whitespace": "IGNORE_ALL_SPACE",
|
"ignore_whitespace": "IGNORE_ALL",
|
||||||
"intraline_difference": true,
|
"intraline_difference": true,
|
||||||
"line_length": 100,
|
"line_length": 100,
|
||||||
"show_tabs": true,
|
"show_tabs": true,
|
||||||
@ -1285,7 +1285,7 @@ link:#diff-preferences-input[DiffPreferencesInput] entity.
|
|||||||
{
|
{
|
||||||
"context": 10,
|
"context": 10,
|
||||||
"theme": "ECLIPSE",
|
"theme": "ECLIPSE",
|
||||||
"ignore_whitespace": "IGNORE_ALL_SPACE",
|
"ignore_whitespace": "IGNORE_ALL",
|
||||||
"intraline_difference": true,
|
"intraline_difference": true,
|
||||||
"line_length": 100,
|
"line_length": 100,
|
||||||
"show_line_endings": true,
|
"show_line_endings": true,
|
||||||
@ -1309,7 +1309,7 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
|
|||||||
{
|
{
|
||||||
"context": 10,
|
"context": 10,
|
||||||
"theme": "ECLIPSE",
|
"theme": "ECLIPSE",
|
||||||
"ignore_whitespace": "IGNORE_ALL_SPACE",
|
"ignore_whitespace": "IGNORE_ALL",
|
||||||
"intraline_difference": true,
|
"intraline_difference": true,
|
||||||
"line_length": 100,
|
"line_length": 100,
|
||||||
"show_line_endings": true,
|
"show_line_endings": true,
|
||||||
@ -1666,8 +1666,8 @@ Whether all inline comments should be automatically expanded.
|
|||||||
|`ignore_whitespace` ||
|
|`ignore_whitespace` ||
|
||||||
Whether whitespace changes should be ignored and if yes, which
|
Whether whitespace changes should be ignored and if yes, which
|
||||||
whitespace changes should be ignored. +
|
whitespace changes should be ignored. +
|
||||||
Allowed values are `IGNORE_NONE`, `IGNORE_SPACE_AT_EOL`,
|
Allowed values are `IGNORE_NONE`, `IGNORE_TRAILING`,
|
||||||
`IGNORE_SPACE_CHANGE`, `IGNORE_ALL_SPACE`.
|
`IGNORE_LEADING_AND_TRAILING`, `IGNORE_ALL`.
|
||||||
|`intraline_difference` |not set if `false`|
|
|`intraline_difference` |not set if `false`|
|
||||||
Whether intraline differences should be highlighted.
|
Whether intraline differences should be highlighted.
|
||||||
|`line_length` ||
|
|`line_length` ||
|
||||||
@ -1722,8 +1722,8 @@ Whether all inline comments should be automatically expanded.
|
|||||||
|`ignore_whitespace` |optional|
|
|`ignore_whitespace` |optional|
|
||||||
Whether whitespace changes should be ignored and if yes, which
|
Whether whitespace changes should be ignored and if yes, which
|
||||||
whitespace changes should be ignored. +
|
whitespace changes should be ignored. +
|
||||||
Allowed values are `IGNORE_NONE`, `IGNORE_SPACE_AT_EOL`,
|
Allowed values are `IGNORE_NONE`, `IGNORE_TRAILING`,
|
||||||
`IGNORE_SPACE_CHANGE`, `IGNORE_ALL_SPACE`.
|
`IGNORE_LEADING_AND_TRAILING`, `IGNORE_ALL`.
|
||||||
|`intraline_difference` |optional|
|
|`intraline_difference` |optional|
|
||||||
Whether intraline differences should be highlighted.
|
Whether intraline differences should be highlighted.
|
||||||
|`line_length` |optional|
|
|`line_length` |optional|
|
||||||
|
@ -74,11 +74,11 @@ public class DiffApi {
|
|||||||
default:
|
default:
|
||||||
case IGNORE_NONE:
|
case IGNORE_NONE:
|
||||||
return ignoreWhitespace(IgnoreWhitespace.NONE);
|
return ignoreWhitespace(IgnoreWhitespace.NONE);
|
||||||
case IGNORE_SPACE_AT_EOL:
|
case IGNORE_TRAILING:
|
||||||
return ignoreWhitespace(IgnoreWhitespace.TRAILING);
|
return ignoreWhitespace(IgnoreWhitespace.TRAILING);
|
||||||
case IGNORE_SPACE_CHANGE:
|
case IGNORE_LEADING_AND_TRAILING:
|
||||||
return ignoreWhitespace(IgnoreWhitespace.CHANGED);
|
return ignoreWhitespace(IgnoreWhitespace.CHANGED);
|
||||||
case IGNORE_ALL_SPACE:
|
case IGNORE_ALL:
|
||||||
return ignoreWhitespace(IgnoreWhitespace.ALL);
|
return ignoreWhitespace(IgnoreWhitespace.ALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,10 @@ package com.google.gerrit.client.diff;
|
|||||||
|
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT;
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT;
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT;
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT;
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_ALL_SPACE;
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_ALL;
|
||||||
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_LEADING_AND_TRAILING;
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE;
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE;
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_SPACE_AT_EOL;
|
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_TRAILING;
|
||||||
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_SPACE_CHANGE;
|
|
||||||
import static com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE;
|
import static com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE;
|
||||||
|
|
||||||
import com.google.gerrit.client.Gerrit;
|
import com.google.gerrit.client.Gerrit;
|
||||||
@ -546,14 +546,14 @@ public class PreferencesBox extends Composite {
|
|||||||
PatchUtil.C.whitespaceIGNORE_NONE(),
|
PatchUtil.C.whitespaceIGNORE_NONE(),
|
||||||
IGNORE_NONE.name());
|
IGNORE_NONE.name());
|
||||||
ignoreWhitespace.addItem(
|
ignoreWhitespace.addItem(
|
||||||
PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL(),
|
PatchUtil.C.whitespaceIGNORE_TRAILING(),
|
||||||
IGNORE_SPACE_AT_EOL.name());
|
IGNORE_TRAILING.name());
|
||||||
ignoreWhitespace.addItem(
|
ignoreWhitespace.addItem(
|
||||||
PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE(),
|
PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING(),
|
||||||
IGNORE_SPACE_CHANGE.name());
|
IGNORE_LEADING_AND_TRAILING.name());
|
||||||
ignoreWhitespace.addItem(
|
ignoreWhitespace.addItem(
|
||||||
PatchUtil.C.whitespaceIGNORE_ALL_SPACE(),
|
PatchUtil.C.whitespaceIGNORE_ALL(),
|
||||||
IGNORE_ALL_SPACE.name());
|
IGNORE_ALL.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMode() {
|
private void initMode() {
|
||||||
|
@ -69,9 +69,9 @@ public interface PatchConstants extends Constants {
|
|||||||
String commentCancelEdit();
|
String commentCancelEdit();
|
||||||
|
|
||||||
String whitespaceIGNORE_NONE();
|
String whitespaceIGNORE_NONE();
|
||||||
String whitespaceIGNORE_SPACE_AT_EOL();
|
String whitespaceIGNORE_TRAILING();
|
||||||
String whitespaceIGNORE_SPACE_CHANGE();
|
String whitespaceIGNORE_LEADING_AND_TRAILING();
|
||||||
String whitespaceIGNORE_ALL_SPACE();
|
String whitespaceIGNORE_ALL();
|
||||||
|
|
||||||
String previousFileHelp();
|
String previousFileHelp();
|
||||||
String nextFileHelp();
|
String nextFileHelp();
|
||||||
|
@ -50,9 +50,9 @@ commentSaveDraft = Save draft comment
|
|||||||
commentCancelEdit = Cancel comment edit
|
commentCancelEdit = Cancel comment edit
|
||||||
|
|
||||||
whitespaceIGNORE_NONE=None
|
whitespaceIGNORE_NONE=None
|
||||||
whitespaceIGNORE_SPACE_AT_EOL=At Line End
|
whitespaceIGNORE_TRAILING=At Line End
|
||||||
whitespaceIGNORE_SPACE_CHANGE=Leading, At Line End
|
whitespaceIGNORE_LEADING_AND_TRAILING=Leading, At Line End
|
||||||
whitespaceIGNORE_ALL_SPACE=All
|
whitespaceIGNORE_ALL=All
|
||||||
|
|
||||||
previousFileHelp = Previous file
|
previousFileHelp = Previous file
|
||||||
nextFileHelp = Next file
|
nextFileHelp = Next file
|
||||||
|
@ -289,12 +289,12 @@ public class PatchScriptSettingsPanel extends Composite {
|
|||||||
private void initIgnoreWhitespace(ListBox ws) {
|
private void initIgnoreWhitespace(ListBox ws) {
|
||||||
ws.addItem(PatchUtil.C.whitespaceIGNORE_NONE(), //
|
ws.addItem(PatchUtil.C.whitespaceIGNORE_NONE(), //
|
||||||
Whitespace.IGNORE_NONE.name());
|
Whitespace.IGNORE_NONE.name());
|
||||||
ws.addItem(PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL(), //
|
ws.addItem(PatchUtil.C.whitespaceIGNORE_TRAILING(), //
|
||||||
Whitespace.IGNORE_SPACE_AT_EOL.name());
|
Whitespace.IGNORE_TRAILING.name());
|
||||||
ws.addItem(PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE(), //
|
ws.addItem(PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING(), //
|
||||||
Whitespace.IGNORE_SPACE_CHANGE.name());
|
Whitespace.IGNORE_LEADING_AND_TRAILING.name());
|
||||||
ws.addItem(PatchUtil.C.whitespaceIGNORE_ALL_SPACE(), //
|
ws.addItem(PatchUtil.C.whitespaceIGNORE_ALL(), //
|
||||||
Whitespace.IGNORE_ALL_SPACE.name());
|
Whitespace.IGNORE_ALL.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initContext(ListBox context) {
|
private void initContext(ListBox context) {
|
||||||
|
@ -32,9 +32,9 @@ public class AccountDiffPreference {
|
|||||||
|
|
||||||
public static enum Whitespace implements CodedEnum {
|
public static enum Whitespace implements CodedEnum {
|
||||||
IGNORE_NONE('N'), //
|
IGNORE_NONE('N'), //
|
||||||
IGNORE_SPACE_AT_EOL('E'), //
|
IGNORE_TRAILING('E'), //
|
||||||
IGNORE_SPACE_CHANGE('S'), //
|
IGNORE_LEADING_AND_TRAILING('S'), //
|
||||||
IGNORE_ALL_SPACE('A');
|
IGNORE_ALL('A');
|
||||||
|
|
||||||
private final char code;
|
private final char code;
|
||||||
|
|
||||||
|
@ -370,9 +370,9 @@ public class GetDiff implements RestReadView<FileResource> {
|
|||||||
|
|
||||||
enum IgnoreWhitespace {
|
enum IgnoreWhitespace {
|
||||||
NONE(AccountDiffPreference.Whitespace.IGNORE_NONE),
|
NONE(AccountDiffPreference.Whitespace.IGNORE_NONE),
|
||||||
TRAILING(AccountDiffPreference.Whitespace.IGNORE_SPACE_AT_EOL),
|
TRAILING(AccountDiffPreference.Whitespace.IGNORE_TRAILING),
|
||||||
CHANGED(AccountDiffPreference.Whitespace.IGNORE_SPACE_CHANGE),
|
CHANGED(AccountDiffPreference.Whitespace.IGNORE_LEADING_AND_TRAILING),
|
||||||
ALL(AccountDiffPreference.Whitespace.IGNORE_ALL_SPACE);
|
ALL(AccountDiffPreference.Whitespace.IGNORE_ALL);
|
||||||
|
|
||||||
private final AccountDiffPreference.Whitespace whitespace;
|
private final AccountDiffPreference.Whitespace whitespace;
|
||||||
|
|
||||||
|
@ -129,13 +129,13 @@ public class PatchListLoader implements Callable<PatchList> {
|
|||||||
|
|
||||||
private static RawTextComparator comparatorFor(Whitespace ws) {
|
private static RawTextComparator comparatorFor(Whitespace ws) {
|
||||||
switch (ws) {
|
switch (ws) {
|
||||||
case IGNORE_ALL_SPACE:
|
case IGNORE_ALL:
|
||||||
return RawTextComparator.WS_IGNORE_ALL;
|
return RawTextComparator.WS_IGNORE_ALL;
|
||||||
|
|
||||||
case IGNORE_SPACE_AT_EOL:
|
case IGNORE_TRAILING:
|
||||||
return RawTextComparator.WS_IGNORE_TRAILING;
|
return RawTextComparator.WS_IGNORE_TRAILING;
|
||||||
|
|
||||||
case IGNORE_SPACE_CHANGE:
|
case IGNORE_LEADING_AND_TRAILING:
|
||||||
return RawTextComparator.WS_IGNORE_CHANGE;
|
return RawTextComparator.WS_IGNORE_CHANGE;
|
||||||
|
|
||||||
case IGNORE_NONE:
|
case IGNORE_NONE:
|
||||||
|
Loading…
Reference in New Issue
Block a user