解决spring的Bug以及实现了EL表达式绑定基本元素属性

This commit is contained in:
billkiller
2019-07-24 23:00:38 +08:00
parent 6fcd94e94b
commit 34ae7db92f
48 changed files with 1852 additions and 1220 deletions

View File

@@ -1,19 +0,0 @@
package cn.edu.scau.biubiusuisui.function;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
/**
* @Author jack
* @Date:2019/6/28 15:57
*/
public class DefaultEventFunction implements ChangeListener {
public DefaultEventFunction() {}
@Override
public void changed(ObservableValue observable, Object oldValue, Object newValue) {
}
}

View File

@@ -1,56 +0,0 @@
package cn.edu.scau.biubiusuisui.function;
import cn.edu.scau.biubiusuisui.annotation.FXBind;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusContext;
import com.sun.javafx.fxml.BeanAdapter;
import com.sun.javafx.fxml.expression.Expression;
import com.sun.javafx.fxml.expression.ExpressionValue;
import javafx.beans.property.Property;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableMap;
import java.lang.reflect.Field;
import java.util.Map;
/**
* @Author jack
* @Date:2019/7/4 13:55
*/
public class FXExpressionParser {
private static final String BIND_EXPRESSION_PREFIX = "${";
private static final String BIND_EXPRESSION_SUFIX = "}";
public static void parse(FXBaseController fxBaseController, ObservableMap<String, Object> namespaces) {
// Class clazz = fxBaseController.getClass();
// Field[] fields = clazz.getDeclaredFields();
// for (Field field : fields) {
// FXBind fxBind = field.getDeclaredAnnotation(FXBind.class);
// if (fxBind != null) {
// String[] names = fxBind.bind();
// for (String propertyName : names) {
// String args[] = propertyName.split("=");
// String name = args[0];
// String value = args[1];
// if (value.startsWith(BIND_EXPRESSION_PREFIX) && value.endsWith(BIND_EXPRESSION_SUFIX)) {
// value = value.substring(BIND_EXPRESSION_PREFIX.length(), value.length() - 1);
// Object object = null;
// try {
// field.setAccessible(true);
// object = field.get(fxBaseController);
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// }
//
// BeanAdapter targetAdapter = new BeanAdapter(object);
// ObservableValue<Object> propertyModel = targetAdapter.getPropertyModel(name);
// Class<?> type = targetAdapter.getType(name);
// if (propertyModel instanceof Property<?>) {
// ((Property<Object>) propertyModel).bind(FXPlusContext.getEntityPropertyByName(fxBaseController,));
// }
// }
// }
// }
}
}

View File

@@ -1,7 +1,6 @@
package cn.edu.scau.biubiusuisui.function;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.function.DragWindowHandlerImpl;
import javafx.event.EventHandler;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;