Browse Source

REPORT-14835 调整代码

research/10.0
XiaXiang 6 years ago
parent
commit
68999ff909
  1. 16
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  2. 11
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java
  4. 4
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java

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

@ -1,12 +1,12 @@
package com.fr.design.mainframe.vcs.common; package com.fr.design.mainframe.vcs.common;
import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.general.IOUtils;
import com.fr.report.entity.VcsEntity; import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -40,13 +40,13 @@ public class VcsHelper {
public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10); public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10);
public final static Icon VCS_LIST_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/vcs_list.png"); public final static Icon VCS_LIST_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/vcs_list.png");
public final static Icon VCS_BACK_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/vcs_back.png"); public final static Icon VCS_BACK_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/vcs_back.png");
public final static Icon VCS_FILTER_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_filter@1x.png"); public final static Icon VCS_FILTER_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_filter@1x.png");
public final static Icon VCS_EDIT_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_edit.png"); public final static Icon VCS_EDIT_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_edit.png");
public final static Icon VCS_DELETE_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_delete.png"); public final static Icon VCS_DELETE_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_delete.png");
public final static Icon VCS_USER_PNG = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_user@1x.png"); public final static Icon VCS_USER_PNG = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_user@1x.png");
public final static Icon VCS_REVERT = BaseUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_revert.png"); public final static Icon VCS_REVERT = IOUtils.readIcon("/com/fr/design/mainframe/vcs/images/icon_revert.png");
private static int containsFolderCounts() { private static int containsFolderCounts() {
TemplateFileTree fileTree = TemplateTreePane.getInstance().getTemplateFileTree(); TemplateFileTree fileTree = TemplateTreePane.getInstance().getTemplateFileTree();

11
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java

@ -17,6 +17,7 @@ import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Toolkit;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -42,7 +43,7 @@ public class EditFileVersionDialog extends UIDialog {
initComponents(); initComponents();
setModal(true); setModal(true);
setTitle(InterProviderFactory.getProvider().getLocText("Fine-Design_Vcs_Save_Version")); setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Save_Version"));
setSize(300, 220); setSize(300, 220);
setResizable(false); setResizable(false);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
@ -52,13 +53,13 @@ public class EditFileVersionDialog extends UIDialog {
private void initComponents() { private void initComponents() {
JPanel fontPane = new JPanel(new BorderLayout()); JPanel fontPane = new JPanel(new BorderLayout());
fontPane.add(new UILabel(" " + InterProviderFactory.getProvider().getLocText("Fine-Design_Vcs_Version_Message") + ":"), BorderLayout.NORTH); fontPane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Version_Message") + ":"), BorderLayout.NORTH);
msgTestArea.setBorder(null); msgTestArea.setBorder(null);
UIScrollPane scrollPane = new UIScrollPane(msgTestArea); UIScrollPane scrollPane = new UIScrollPane(msgTestArea);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(" " + InterProviderFactory.getProvider().getLocText("Fine-Design_Vcs_Version_Number") + ":"), versionLabel}, new Component[]{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Version_Number") + ":"), versionLabel},
new Component[]{fontPane, scrollPane} new Component[]{fontPane, scrollPane}
}; };
double[] rowSizes = new double[]{25, 100}; double[] rowSizes = new double[]{25, 100};
@ -69,8 +70,8 @@ public class EditFileVersionDialog extends UIDialog {
JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT));
add(buttonPane, BorderLayout.SOUTH); add(buttonPane, BorderLayout.SOUTH);
UIButton ok = new UIButton(InterProviderFactory.getProvider().getLocText("OK")); UIButton ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
UIButton cancel = new UIButton(InterProviderFactory.getProvider().getLocText("Cancel")); UIButton cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel"));
buttonPane.add(ok); buttonPane.add(ok);
buttonPane.add(cancel); buttonPane.add(cancel);

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

@ -8,6 +8,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.report.entity.VcsEntity; import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.VcsOperator;
@ -43,7 +44,7 @@ public class FileVersionDialog extends UIDialog {
upBox.setBorder(EMPTY_BORDER_BOTTOM); upBox.setBorder(EMPTY_BORDER_BOTTOM);
upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime"))); upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime")));
upBox.add(Box.createHorizontalGlue()); upBox.add(Box.createHorizontalGlue());
dateEditor = new DateEditor(new Date(), true, "", UIDatePicker.STYLE_CN_DATE1); dateEditor = new DateEditor(new Date(), true, StringUtils.EMPTY, UIDatePicker.STYLE_CN_DATE1);
upBox.add(dateEditor); upBox.add(dateEditor);
Box downBox = Box.createHorizontalBox(); Box downBox = Box.createHorizontalBox();
downBox.setBorder(EMPTY_BORDER_BOTTOM); downBox.setBorder(EMPTY_BORDER_BOTTOM);

4
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java

@ -32,7 +32,7 @@ public class FileVersionRowPanel extends JPanel {
private VcsEntity vcsEntity; private VcsEntity vcsEntity;
private UILabel versionLabel = new UILabel(); private UILabel versionLabel = new UILabel();
private UILabel usernameLabel = new UILabel("", VcsHelper.VCS_USER_PNG, SwingConstants.LEFT); private UILabel usernameLabel = new UILabel(StringUtils.EMPTY, VcsHelper.VCS_USER_PNG, SwingConstants.LEFT);
private UITextPane timeAndMsgLabel = new UITextPane(); private UITextPane timeAndMsgLabel = new UITextPane();
private UILabel timeLabel = new UILabel(); private UILabel timeLabel = new UILabel();
private EditFileVersionDialog editDialog; private EditFileVersionDialog editDialog;
@ -74,7 +74,7 @@ public class FileVersionRowPanel extends JPanel {
deleteBtn.addActionListener(new ActionListener() { deleteBtn.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (JOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Vcs_Version_Delete_Confirm"), Toolkit.i18nText("FR-Designer_Remove"), if (JOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Vcs_Delete-Confirm"), Toolkit.i18nText("Fine-Design_Vcs_Remove"),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
try { try {
WorkContext.getCurrent().get(VcsOperator.class).deleteVersion(vcsEntity.getFilename(), vcsEntity.getVersion()); WorkContext.getCurrent().get(VcsOperator.class).deleteVersion(vcsEntity.getFilename(), vcsEntity.getVersion());

Loading…
Cancel
Save