fix indents

This commit is contained in:
yushijinhun 2018-02-18 17:07:54 +08:00
parent 3cfcf1e772
commit a5f3ec7b9b
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
5 changed files with 37 additions and 37 deletions

View File

@ -72,10 +72,10 @@ public final class Accounts {
.orElseThrow(() -> new IllegalArgumentException("Account " + account + " has not set current character.")); .orElseThrow(() -> new IllegalArgumentException("Account " + account + " has not set current character."));
} }
public static Optional<String> getCurrentCharacter(Map<Object, Object> storage) { public static Optional<String> getCurrentCharacter(Map<Object, Object> storage) {
return Lang.get(storage, "properties", Map.class) return Lang.get(storage, "properties", Map.class)
.flatMap(properties -> Lang.get(properties, "character", String.class)); .flatMap(properties -> Lang.get(properties, "character", String.class));
} }
static String getAccountId(Account account) { static String getAccountId(Account account) {
return getAccountId(account.getUsername(), getCurrentCharacter(account)); return getAccountId(account.getUsername(), getCurrentCharacter(account));

View File

@ -94,37 +94,37 @@ public final class FXUtils {
}); });
} }
private static class ListenerPair<T> { private static class ListenerPair<T> {
ObservableValue<T> value; ObservableValue<T> value;
ChangeListener<? super T> listener; ChangeListener<? super T> listener;
ListenerPair(ObservableValue<T> value, ChangeListener<? super T> listener) { ListenerPair(ObservableValue<T> value, ChangeListener<? super T> listener) {
this.value = value; this.value = value;
this.listener = listener; this.listener = listener;
} }
void bind() { void bind() {
value.addListener(listener); value.addListener(listener);
} }
void unbind() { void unbind() {
value.removeListener(listener); value.removeListener(listener);
} }
} }
public static <T> void addListener(Node node, String key, ObservableValue<T> value, Consumer<? super T> callback) { public static <T> void addListener(Node node, String key, ObservableValue<T> value, Consumer<? super T> callback) {
ListenerPair<T> pair = new ListenerPair<>(value, (a, b, newValue) -> callback.accept(newValue)); ListenerPair<T> pair = new ListenerPair<>(value, (a, b, newValue) -> callback.accept(newValue));
node.getProperties().put(key, pair); node.getProperties().put(key, pair);
pair.bind(); pair.bind();
} }
public static void removeListener(Node node, String key) { public static void removeListener(Node node, String key) {
Lang.convert(node.getProperties().get(key), ListenerPair.class) Lang.convert(node.getProperties().get(key), ListenerPair.class)
.ifPresent(info -> { .ifPresent(info -> {
info.unbind(); info.unbind();
node.getProperties().remove(key); node.getProperties().remove(key);
}); });
} }
public static void setValidateWhileTextChanged(Node field, boolean validate) { public static void setValidateWhileTextChanged(Node field, boolean validate) {
if (field instanceof JFXTextField) { if (field instanceof JFXTextField) {

View File

@ -23,7 +23,7 @@ import javafx.scene.control.MultipleSelectionModel;
public class NoneMultipleSelectionModel<T> extends MultipleSelectionModel<T> { public class NoneMultipleSelectionModel<T> extends MultipleSelectionModel<T> {
public NoneMultipleSelectionModel() { public NoneMultipleSelectionModel() {
} }
@Override @Override

View File

@ -218,12 +218,12 @@ public class RipplerContainer extends StackPane {
private static final CssMetaData<RipplerContainer, Paint> RIPPLER_FILL = new CssMetaData<RipplerContainer, Paint>("-jfx-rippler-fill", StyleConverter.getPaintConverter(), Color.rgb(0, 200, 255)) { private static final CssMetaData<RipplerContainer, Paint> RIPPLER_FILL = new CssMetaData<RipplerContainer, Paint>("-jfx-rippler-fill", StyleConverter.getPaintConverter(), Color.rgb(0, 200, 255)) {
@Override @Override
public boolean isSettable(RipplerContainer control) { public boolean isSettable(RipplerContainer control) {
return control.ripplerFill == null || !control.ripplerFill.isBound(); return control.ripplerFill == null || !control.ripplerFill.isBound();
} }
@Override @Override
public StyleableProperty<Paint> getStyleableProperty(RipplerContainer control) { public StyleableProperty<Paint> getStyleableProperty(RipplerContainer control) {
return control.ripplerFillProperty(); return control.ripplerFillProperty();
} }
}; };

View File

@ -44,11 +44,11 @@ public final class ExportWizardProvider implements WizardProvider {
@Override @Override
public Object finish(Map<String, Object> settings) { public Object finish(Map<String, Object> settings) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<String> whitelist = (List<String>) settings.get(ModpackFileSelectionPage.MODPACK_FILE_SELECTION); List<String> whitelist = (List<String>) settings.get(ModpackFileSelectionPage.MODPACK_FILE_SELECTION);
return new HMCLModpackExportTask(profile.getRepository(), version, whitelist, return new HMCLModpackExportTask(profile.getRepository(), version, whitelist,
new Modpack( new Modpack(
(String) settings.get(ModpackInfoPage.MODPACK_NAME), (String) settings.get(ModpackInfoPage.MODPACK_NAME),
(String) settings.get(ModpackInfoPage.MODPACK_AUTHOR), (String) settings.get(ModpackInfoPage.MODPACK_AUTHOR),
(String) settings.get(ModpackInfoPage.MODPACK_VERSION), (String) settings.get(ModpackInfoPage.MODPACK_VERSION),