Rename Whitespace enum to make the intent more clear

Change-Id: I591abfe195a9cb2baf3ac516c7874d28ef70f20e
This commit is contained in:
David Ostrovsky 2015-10-24 13:03:34 +02:00 committed by David Ostrovsky
parent dc53a1665b
commit 09caa54a0e
9 changed files with 40 additions and 40 deletions

View File

@ -1256,7 +1256,7 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
{
"context": 10,
"theme": "DEFAULT",
"ignore_whitespace": "IGNORE_ALL_SPACE",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
"show_tabs": true,
@ -1285,7 +1285,7 @@ link:#diff-preferences-input[DiffPreferencesInput] entity.
{
"context": 10,
"theme": "ECLIPSE",
"ignore_whitespace": "IGNORE_ALL_SPACE",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
"show_line_endings": true,
@ -1309,7 +1309,7 @@ link:#diff-preferences-info[DiffPreferencesInfo] entity.
{
"context": 10,
"theme": "ECLIPSE",
"ignore_whitespace": "IGNORE_ALL_SPACE",
"ignore_whitespace": "IGNORE_ALL",
"intraline_difference": true,
"line_length": 100,
"show_line_endings": true,
@ -1666,8 +1666,8 @@ Whether all inline comments should be automatically expanded.
|`ignore_whitespace` ||
Whether whitespace changes should be ignored and if yes, which
whitespace changes should be ignored. +
Allowed values are `IGNORE_NONE`, `IGNORE_SPACE_AT_EOL`,
`IGNORE_SPACE_CHANGE`, `IGNORE_ALL_SPACE`.
Allowed values are `IGNORE_NONE`, `IGNORE_TRAILING`,
`IGNORE_LEADING_AND_TRAILING`, `IGNORE_ALL`.
|`intraline_difference` |not set if `false`|
Whether intraline differences should be highlighted.
|`line_length` ||
@ -1722,8 +1722,8 @@ Whether all inline comments should be automatically expanded.
|`ignore_whitespace` |optional|
Whether whitespace changes should be ignored and if yes, which
whitespace changes should be ignored. +
Allowed values are `IGNORE_NONE`, `IGNORE_SPACE_AT_EOL`,
`IGNORE_SPACE_CHANGE`, `IGNORE_ALL_SPACE`.
Allowed values are `IGNORE_NONE`, `IGNORE_TRAILING`,
`IGNORE_LEADING_AND_TRAILING`, `IGNORE_ALL`.
|`intraline_difference` |optional|
Whether intraline differences should be highlighted.
|`line_length` |optional|

View File

@ -74,11 +74,11 @@ public class DiffApi {
default:
case IGNORE_NONE:
return ignoreWhitespace(IgnoreWhitespace.NONE);
case IGNORE_SPACE_AT_EOL:
case IGNORE_TRAILING:
return ignoreWhitespace(IgnoreWhitespace.TRAILING);
case IGNORE_SPACE_CHANGE:
case IGNORE_LEADING_AND_TRAILING:
return ignoreWhitespace(IgnoreWhitespace.CHANGED);
case IGNORE_ALL_SPACE:
case IGNORE_ALL:
return ignoreWhitespace(IgnoreWhitespace.ALL);
}
}

View File

@ -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.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_SPACE_AT_EOL;
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_SPACE_CHANGE;
import static com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_TRAILING;
import static com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE;
import com.google.gerrit.client.Gerrit;
@ -546,14 +546,14 @@ public class PreferencesBox extends Composite {
PatchUtil.C.whitespaceIGNORE_NONE(),
IGNORE_NONE.name());
ignoreWhitespace.addItem(
PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL(),
IGNORE_SPACE_AT_EOL.name());
PatchUtil.C.whitespaceIGNORE_TRAILING(),
IGNORE_TRAILING.name());
ignoreWhitespace.addItem(
PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE(),
IGNORE_SPACE_CHANGE.name());
PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING(),
IGNORE_LEADING_AND_TRAILING.name());
ignoreWhitespace.addItem(
PatchUtil.C.whitespaceIGNORE_ALL_SPACE(),
IGNORE_ALL_SPACE.name());
PatchUtil.C.whitespaceIGNORE_ALL(),
IGNORE_ALL.name());
}
private void initMode() {

View File

@ -69,9 +69,9 @@ public interface PatchConstants extends Constants {
String commentCancelEdit();
String whitespaceIGNORE_NONE();
String whitespaceIGNORE_SPACE_AT_EOL();
String whitespaceIGNORE_SPACE_CHANGE();
String whitespaceIGNORE_ALL_SPACE();
String whitespaceIGNORE_TRAILING();
String whitespaceIGNORE_LEADING_AND_TRAILING();
String whitespaceIGNORE_ALL();
String previousFileHelp();
String nextFileHelp();

View File

@ -50,9 +50,9 @@ commentSaveDraft = Save draft comment
commentCancelEdit = Cancel comment edit
whitespaceIGNORE_NONE=None
whitespaceIGNORE_SPACE_AT_EOL=At Line End
whitespaceIGNORE_SPACE_CHANGE=Leading, At Line End
whitespaceIGNORE_ALL_SPACE=All
whitespaceIGNORE_TRAILING=At Line End
whitespaceIGNORE_LEADING_AND_TRAILING=Leading, At Line End
whitespaceIGNORE_ALL=All
previousFileHelp = Previous file
nextFileHelp = Next file

View File

@ -289,12 +289,12 @@ public class PatchScriptSettingsPanel extends Composite {
private void initIgnoreWhitespace(ListBox ws) {
ws.addItem(PatchUtil.C.whitespaceIGNORE_NONE(), //
Whitespace.IGNORE_NONE.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL(), //
Whitespace.IGNORE_SPACE_AT_EOL.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE(), //
Whitespace.IGNORE_SPACE_CHANGE.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_ALL_SPACE(), //
Whitespace.IGNORE_ALL_SPACE.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_TRAILING(), //
Whitespace.IGNORE_TRAILING.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING(), //
Whitespace.IGNORE_LEADING_AND_TRAILING.name());
ws.addItem(PatchUtil.C.whitespaceIGNORE_ALL(), //
Whitespace.IGNORE_ALL.name());
}
private void initContext(ListBox context) {

View File

@ -32,9 +32,9 @@ public class AccountDiffPreference {
public static enum Whitespace implements CodedEnum {
IGNORE_NONE('N'), //
IGNORE_SPACE_AT_EOL('E'), //
IGNORE_SPACE_CHANGE('S'), //
IGNORE_ALL_SPACE('A');
IGNORE_TRAILING('E'), //
IGNORE_LEADING_AND_TRAILING('S'), //
IGNORE_ALL('A');
private final char code;

View File

@ -370,9 +370,9 @@ public class GetDiff implements RestReadView<FileResource> {
enum IgnoreWhitespace {
NONE(AccountDiffPreference.Whitespace.IGNORE_NONE),
TRAILING(AccountDiffPreference.Whitespace.IGNORE_SPACE_AT_EOL),
CHANGED(AccountDiffPreference.Whitespace.IGNORE_SPACE_CHANGE),
ALL(AccountDiffPreference.Whitespace.IGNORE_ALL_SPACE);
TRAILING(AccountDiffPreference.Whitespace.IGNORE_TRAILING),
CHANGED(AccountDiffPreference.Whitespace.IGNORE_LEADING_AND_TRAILING),
ALL(AccountDiffPreference.Whitespace.IGNORE_ALL);
private final AccountDiffPreference.Whitespace whitespace;

View File

@ -129,13 +129,13 @@ public class PatchListLoader implements Callable<PatchList> {
private static RawTextComparator comparatorFor(Whitespace ws) {
switch (ws) {
case IGNORE_ALL_SPACE:
case IGNORE_ALL:
return RawTextComparator.WS_IGNORE_ALL;
case IGNORE_SPACE_AT_EOL:
case IGNORE_TRAILING:
return RawTextComparator.WS_IGNORE_TRAILING;
case IGNORE_SPACE_CHANGE:
case IGNORE_LEADING_AND_TRAILING:
return RawTextComparator.WS_IGNORE_CHANGE;
case IGNORE_NONE: