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."));
}
public static Optional<String> getCurrentCharacter(Map<Object, Object> storage) {
return Lang.get(storage, "properties", Map.class)
.flatMap(properties -> Lang.get(properties, "character", String.class));
}
public static Optional<String> getCurrentCharacter(Map<Object, Object> storage) {
return Lang.get(storage, "properties", Map.class)
.flatMap(properties -> Lang.get(properties, "character", String.class));
}
static String getAccountId(Account account) {
return getAccountId(account.getUsername(), getCurrentCharacter(account));

View File

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

View File

@ -23,7 +23,7 @@ import javafx.scene.control.MultipleSelectionModel;
public class NoneMultipleSelectionModel<T> extends MultipleSelectionModel<T> {
public NoneMultipleSelectionModel() {
public NoneMultipleSelectionModel() {
}
@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)) {
@Override
public boolean isSettable(RipplerContainer control) {
public boolean isSettable(RipplerContainer control) {
return control.ripplerFill == null || !control.ripplerFill.isBound();
}
@Override
public StyleableProperty<Paint> getStyleableProperty(RipplerContainer control) {
public StyleableProperty<Paint> getStyleableProperty(RipplerContainer control) {
return control.ripplerFillProperty();
}
};

View File

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