diff --git a/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/InterviewTypeNewItemBuilder.java b/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/InterviewTypeNewItemBuilder.java index 70f81d8..8df4d2e 100644 --- a/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/InterviewTypeNewItemBuilder.java +++ b/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/InterviewTypeNewItemBuilder.java @@ -8,9 +8,24 @@ import org.cutem.cutecalendar.model.TodoItemFactory; import org.jetbrains.annotations.Nullable; public class InterviewTypeNewItemBuilder extends NewItemBuilder { + + public static class Factory implements IFactory { + + @Override + public String getTypeName() { + return TYPE_NAME; + } + + @Override + public NewItemBuilder construct(@Nullable TodoItem parent) { + return new InterviewTypeNewItemBuilder(parent); + } + } + private static final int TYPE = TodoItem.INTERVIEW; private static final String TYPE_NAME = TodoItem.typeName(TYPE); private static final String INTERVIEW_TYPE_LAYOUT = "fxml/newitem_layouts/interview_type_layout.fxml"; + @FXML private TextField bgnTimeText; @FXML @@ -39,6 +54,17 @@ public class InterviewTypeNewItemBuilder extends NewItemBuilder { loadLayout(INTERVIEW_TYPE_LAYOUT); } + @FXML + private void initialize() { + addAutoCheckTime(bgnTimeText.textProperty(), endTimeText.textProperty()); + addAutoSet(TodoItem.LOCATION, locationText.textProperty(), "请添加地点"); + addAutoSet(TodoItem.TITLE, remarkText.textProperty(), "请填写备注"); + addAutoSet("company", companyText.textProperty(), "请填写公司"); + addAutoSet("岗位", companyText.textProperty(), "请填写岗位"); + addAutoSet(TodoItem.ALARM_START, alarmStartText.textProperty(), "提醒的开始时间不合法"); + addAutoSet(TodoItem.ALARM_INTERVAL, alarmIntervalText.textProperty(), "提醒的间隔时间不合法"); + } + @Override protected boolean check() { return autoCheck(); @@ -58,28 +84,4 @@ public class InterviewTypeNewItemBuilder extends NewItemBuilder { .stringProperties(TodoItem.ALARM_METHOD, alarmMethod) .build(); } - - public static class Factory implements IFactory { - - @Override - public String getTypeName() { - return TYPE_NAME; - } - - @Override - public NewItemBuilder construct(@Nullable TodoItem parent) { - return new InterviewTypeNewItemBuilder(parent); - } - } - - @FXML - private void initialize() { - addAutoCheckTime(bgnTimeText.textProperty(), endTimeText.textProperty()); - addAutoSet(TodoItem.LOCATION, locationText.textProperty(), "请添加地点"); - addAutoSet(TodoItem.TITLE, remarkText.textProperty(), "请填写备注"); - addAutoSet("company", companyText.textProperty(), "请填写公司"); - addAutoSet("岗位", companyText.textProperty(), "请填写岗位"); - addAutoSet(TodoItem.ALARM_START, alarmStartText.textProperty(), "提醒的开始时间不合法"); - addAutoSet(TodoItem.ALARM_INTERVAL, alarmIntervalText.textProperty(), "提醒的间隔时间不合法"); - } } diff --git a/app/src/test/java/org/cutem/MainTest.java b/app/src/test/java/org/cutem/MainTest.java index 3183a5d..c71caaa 100644 --- a/app/src/test/java/org/cutem/MainTest.java +++ b/app/src/test/java/org/cutem/MainTest.java @@ -63,6 +63,8 @@ public class MainTest extends Application { newItemStrategy.addFactory(new ConferenceTypeNewItemBuilder.Factory()); newItemStrategy.addFactory(new InterviewTypeNewItemBuilder.Factory()); newItemStrategy.addFactory(new AnniversaryTypeNewItemBuilder.Factory()); + newItemStrategy.addFactory(new CourseTypeBuilder.Factory()); + newItemStrategy.addFactory(new DateTypeBuilder.Factory()); mPresenter.goWork(); }