|
|
@ -25,6 +25,7 @@ import java.awt.Frame; |
|
|
|
import java.awt.Window; |
|
|
|
import java.awt.Window; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
@ -32,6 +33,8 @@ import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
public class FileVersionDialog extends UIDialog { |
|
|
|
public class FileVersionDialog extends UIDialog { |
|
|
|
public static final long DELAY = 24 * 60 * 60 * 1000L; |
|
|
|
public static final long DELAY = 24 * 60 * 60 * 1000L; |
|
|
|
|
|
|
|
private static final int LAST_HOUR_OF_DAY = 23; |
|
|
|
|
|
|
|
private static final int LAST_MINUTE = 59; |
|
|
|
private UIButton okBtn; |
|
|
|
private UIButton okBtn; |
|
|
|
private UIButton cancelBtn; |
|
|
|
private UIButton cancelBtn; |
|
|
|
private DateEditor dateEditor; |
|
|
|
private DateEditor dateEditor; |
|
|
@ -66,7 +69,7 @@ public class FileVersionDialog extends UIDialog { |
|
|
|
FileVersionDialog.this.setVisible(false); |
|
|
|
FileVersionDialog.this.setVisible(false); |
|
|
|
Date editorDate = dateEditor.getValue(); |
|
|
|
Date editorDate = dateEditor.getValue(); |
|
|
|
Date start = editorDate == null ? new Date(0) : editorDate; |
|
|
|
Date start = editorDate == null ? new Date(0) : editorDate; |
|
|
|
Date end = editorDate == null ? DateUtils.getLastHour() : new Date(start.getTime() + DELAY); |
|
|
|
Date end = editorDate == null ? getLastHour() : new Date(start.getTime() + DELAY); |
|
|
|
List<VcsEntity> vcsEntities = WorkContext.getCurrent().get(VcsOperator.class).getFilterVersions(fileName, start, end, textField.getText()); |
|
|
|
List<VcsEntity> vcsEntities = WorkContext.getCurrent().get(VcsOperator.class).getFilterVersions(fileName, start, end, textField.getText()); |
|
|
|
FileVersionTable.getInstance().updateModel(1, vcsEntities); |
|
|
|
FileVersionTable.getInstance().updateModel(1, vcsEntities); |
|
|
|
|
|
|
|
|
|
|
@ -109,4 +112,18 @@ public class FileVersionDialog extends UIDialog { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当天 23 点 59 分 59 秒 |
|
|
|
|
|
|
|
* //todo 兼容
|
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 日期 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private static Date getLastHour() { |
|
|
|
|
|
|
|
Calendar date = Calendar.getInstance(); |
|
|
|
|
|
|
|
date.set(Calendar.HOUR_OF_DAY, LAST_HOUR_OF_DAY); |
|
|
|
|
|
|
|
date.set(Calendar.MINUTE, LAST_MINUTE); |
|
|
|
|
|
|
|
date.set(Calendar.SECOND, LAST_MINUTE); |
|
|
|
|
|
|
|
return date.getTime(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|