diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 27c606f4c3..ecde0e1331 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -34,8 +34,10 @@ public class VcsHelper { : WorkContext.getCurrent().getConnection().getUserName(); public final static Color TABLE_SELECT_BACKGROUND = new Color(0xD8F2FD); + public final static Color COPY_VERSION_BTN_COLOR = new Color(0x419BF9); - public final static EmptyBorder EMPTY_BORDER = new EmptyBorder(5, 10, 0, 10); + + public final static EmptyBorder EMPTY_BORDER = new EmptyBorder(10, 10, 0, 10); public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java index 6f6c925382..cb7234640d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionDialog.java @@ -7,6 +7,7 @@ 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.design.mainframe.vcs.common.VcsHelper; import com.fr.report.entity.VcsEntity; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -17,6 +18,7 @@ import javax.swing.Box; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.Frame; import java.awt.Window; import java.awt.event.ActionEvent; @@ -24,14 +26,12 @@ import java.awt.event.ActionListener; import java.util.Date; import java.util.List; -import static com.fr.design.mainframe.vcs.common.VcsHelper.EMPTY_BORDER; -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(Toolkit.i18nText("Fine-Design_Report_OK")); - private UIButton cancelBtn = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel")); + private UIButton okBtn; + private UIButton cancelBtn; private DateEditor dateEditor; private UITextField textField; @@ -39,23 +39,25 @@ public class FileVersionDialog extends UIDialog { public FileVersionDialog(Frame frame) { super(frame); setUndecorated(true); + setModal(true); JPanel panel = new JPanel(new BorderLayout()); Box upBox = Box.createHorizontalBox(); - upBox.setBorder(EMPTY_BORDER_BOTTOM); - upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime"))); + upBox.setBorder(VcsHelper.EMPTY_BORDER); + upBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_buildTime") + " ")); upBox.add(Box.createHorizontalGlue()); dateEditor = new DateEditor(new Date(), true, StringUtils.EMPTY, 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"))); + downBox.setBorder(VcsHelper.EMPTY_BORDER); + downBox.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_CommitMsg") + " ")); textField = new UITextField(); downBox.add(textField); - Box box2 = Box.createHorizontalBox(); - box2.add(Box.createHorizontalGlue()); - box2.setBorder(EMPTY_BORDER); - box2.add(okBtn); - box2.add(cancelBtn); + JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + okBtn = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); + cancelBtn = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel")); + buttonPane.setBorder(VcsHelper.EMPTY_BORDER); + buttonPane.add(okBtn); + buttonPane.add(cancelBtn); okBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -74,9 +76,9 @@ public class FileVersionDialog extends UIDialog { }); panel.add(upBox, BorderLayout.NORTH); panel.add(downBox, BorderLayout.CENTER); - panel.add(box2, BorderLayout.SOUTH); + panel.add(buttonPane, BorderLayout.SOUTH); add(panel); - setSize(new Dimension(220, 100)); + setSize(new Dimension(230, 105)); centerWindow(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java index 78f8c62f44..657e990cc4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java @@ -33,7 +33,7 @@ public class FileVersionRowPanel extends JPanel { private VcsEntity vcsEntity; private UILabel versionLabel = new UILabel(); private UILabel usernameLabel = new UILabel(StringUtils.EMPTY, VcsHelper.VCS_USER_PNG, SwingConstants.LEFT); - private UITextPane timeAndMsgLabel = new UITextPane(); + private UITextPane msgLabel = new UITextPane(); private UILabel timeLabel = new UILabel(); private EditFileVersionDialog editDialog; @@ -49,12 +49,12 @@ public class FileVersionRowPanel extends JPanel { // msg - timeAndMsgLabel.setBorder(VcsHelper.EMPTY_BORDER); - timeAndMsgLabel.setOpaque(false); - timeAndMsgLabel.setBackground(new Color(0, 0, 0, 0)); - timeAndMsgLabel.setEditable(false); + msgLabel.setBorder(VcsHelper.EMPTY_BORDER); + msgLabel.setOpaque(false); + msgLabel.setBackground(new Color(0, 0, 0, 0)); + msgLabel.setEditable(false); - // confirm + delete + // confirm + delete + edit UIButton confirmBtn = new UIButton(VcsHelper.VCS_REVERT); confirmBtn.set4ToolbarButton(); confirmBtn.setToolTipText(Toolkit.i18nText("Fine-Design_Vcs_Revert")); @@ -108,9 +108,10 @@ public class FileVersionRowPanel extends JPanel { downPane.add(usernameLabel); downPane.setBorder(VcsHelper.EMPTY_BORDER_BOTTOM); downPane.add(Box.createHorizontalGlue()); + timeLabel.setForeground(VcsHelper.COPY_VERSION_BTN_COLOR); downPane.add(timeLabel); add(upPane, BorderLayout.NORTH); - add(timeAndMsgLabel, BorderLayout.CENTER); + add(msgLabel, BorderLayout.CENTER); add(downPane, BorderLayout.SOUTH); } @@ -126,11 +127,11 @@ public class FileVersionRowPanel extends JPanel { this.vcsEntity = fileVersion; versionLabel.setText(String.format("V.%s", fileVersion.getVersion())); usernameLabel.setText(fileVersion.getUsername()); - timeAndMsgLabel.setText(StringUtils.EMPTY); + msgLabel.setText(StringUtils.EMPTY); timeLabel.setText(timeStr(fileVersion.getTime())); try { - StyledDocument doc = timeAndMsgLabel.getStyledDocument(); - Style style = timeAndMsgLabel.getLogicalStyle(); + StyledDocument doc = msgLabel.getStyledDocument(); + Style style = msgLabel.getLogicalStyle(); StyleConstants.setForeground(style, Color.BLACK); doc.insertString(doc.getLength(), " " + fileVersion.getCommitMsg(), style); } catch (BadLocationException e) {