Browse Source

REPORT-14835 调整代码

research/10.0
XiaXiang 6 years ago
parent
commit
82d2302ffa
  1. 14
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  3. 29
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java
  4. 3
      designer-realize/src/main/java/com/fr/start/Designer.java

14
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -203,17 +203,17 @@ public class PreferencePane extends BasicPane {
}
private void createVcsSettingPane(JPanel generalPane) {
JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("版本控制"));
JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Vcs_Title"));
generalPane.add(vcsPane);
vcsEnableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("保存自动生成版本"));
saveCommitCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("备注版本不会自动清理"));
vcsEnableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Vcs_SaveAuto"));
saveCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Vcs_No_Delete"));
saveIntervalEditor = new IntegerEditor(30);
JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
UILabel label1 = new UILabel(" 每 ");
UILabel label2 = new UILabel(" 分钟每个用户同个模板最多保留一个模板");
memorySpace.add(label1);
UILabel everyLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Every"));
UILabel delayLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Delay"));
memorySpace.add(everyLabel);
memorySpace.add(saveIntervalEditor);
memorySpace.add(label2);
memorySpace.add(delayLabel);
vcsEnableCheckBox.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {

2
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -68,7 +68,7 @@ public class VcsHelper {
return VcsHelper.containsFolderCounts() + VcsHelper.selectedTemplateCounts() > 1;
}
public static String getEdittingFilename() {
public static String getEditingFilename() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String editingFilePath = jt.getEditingFILE().getPath();
if (editingFilePath.startsWith(ProjectConstants.REPORTLETS_NAME)) {

29
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java

@ -6,6 +6,7 @@ import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.report.ReportContext;
import com.fr.report.entity.VcsEntity;
@ -27,8 +28,8 @@ import static com.fr.design.mainframe.vcs.common.VcsHelper.EMPTY_BORDER_BOTTOM;
public class FileVersionDialog extends UIDialog {
public static final long DELAY = 24 * 60 * 60 * 1000;
private UIButton okBtn = new UIButton("确定");
private UIButton cancelBtn = new UIButton("取消");
private UIButton okBtn = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
private UIButton cancelBtn = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel"));
private DateEditor dateEditor;
private UITextField textField;
@ -37,17 +38,17 @@ public class FileVersionDialog extends UIDialog {
super(frame);
setUndecorated(true);
JPanel panel = new JPanel(new BorderLayout());
Box box0 = Box.createHorizontalBox();
box0.setBorder(EMPTY_BORDER_BOTTOM);
box0.add(new UILabel("生成日期"));
box0.add(Box.createHorizontalGlue());
dateEditor = new DateEditor(new Date(), true, "生成日期", UIDatePicker.STYLE_CN_DATE1);
box0.add(dateEditor);
Box box1 = Box.createHorizontalBox();
box1.setBorder(EMPTY_BORDER_BOTTOM);
box1.add(new UILabel("备注关键词 "));
Box upBox = Box.createHorizontalBox();
upBox.setBorder(EMPTY_BORDER_BOTTOM);
upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime")));
upBox.add(Box.createHorizontalGlue());
dateEditor = new DateEditor(new Date(), true, "", UIDatePicker.STYLE_CN_DATE1);
upBox.add(dateEditor);
Box downBox = Box.createHorizontalBox();
downBox.setBorder(EMPTY_BORDER_BOTTOM);
downBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_CommitMsg")));
textField = new UITextField();
box1.add(textField);
downBox.add(textField);
Box box2 = Box.createHorizontalBox();
box2.add(Box.createHorizontalGlue());
box2.setBorder(EMPTY_BORDER);
@ -69,8 +70,8 @@ public class FileVersionDialog extends UIDialog {
FileVersionDialog.this.setVisible(false);
}
});
panel.add(box0, BorderLayout.NORTH);
panel.add(box1, BorderLayout.CENTER);
panel.add(upBox, BorderLayout.NORTH);
panel.add(downBox, BorderLayout.CENTER);
panel.add(box2, BorderLayout.SOUTH);
add(panel);
setSize(new Dimension(220, 100));

3
designer-realize/src/main/java/com/fr/start/Designer.java

@ -53,7 +53,6 @@ import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.lifecycle.LifecycleFatalError;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLTools;
import com.fr.start.fx.SplashFx;
import com.fr.start.jni.SplashMac;
@ -280,7 +279,7 @@ public class Designer extends BaseDesigner {
jt.stopEditing();
jt.saveTemplate();
jt.requestFocus();
String fileName = VcsHelper.getEdittingFilename();
String fileName = VcsHelper.getEditingFilename();
int latestFileVersion = 0;
try {
latestFileVersion = WorkContext.getCurrent().get(VcsOperator.class).getLatestFileVersion(fileName);

Loading…
Cancel
Save