|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
package com.fr.design.write.submit; |
|
|
|
|
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.general.FRFont; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
@ -18,6 +22,9 @@ import java.awt.Dimension;
|
|
|
|
|
import java.awt.Frame; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author: Maksim |
|
|
|
@ -28,30 +35,31 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
private JPanel topPanel; |
|
|
|
|
private JPanel centerPanel; |
|
|
|
|
private JPanel bottomPanel; |
|
|
|
|
private UICheckBox remindBox; |
|
|
|
|
|
|
|
|
|
public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ |
|
|
|
|
super(parent,true); |
|
|
|
|
//上面的标签面板
|
|
|
|
|
topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
JPanel imagePanel = new JPanel(); |
|
|
|
|
Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning4.png"); |
|
|
|
|
Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); |
|
|
|
|
|
|
|
|
|
JLabel imageLabel = new JLabel(); |
|
|
|
|
imageLabel.setIcon(icon); |
|
|
|
|
imagePanel.add(imageLabel); |
|
|
|
|
imagePanel.setPreferredSize(new Dimension(100,80)); |
|
|
|
|
imagePanel.setPreferredSize(new Dimension(110,80)); |
|
|
|
|
|
|
|
|
|
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
|
FRFont font = FRFont.getInstance(); |
|
|
|
|
font = font.applySize(15).applyStyle(1); |
|
|
|
|
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); |
|
|
|
|
label.setFont(font); |
|
|
|
|
label.setPreferredSize(new Dimension(500,30)); |
|
|
|
|
JLabel label2 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") |
|
|
|
|
+ localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch); |
|
|
|
|
label2.setPreferredSize(new Dimension(500,20)); |
|
|
|
|
label.setPreferredSize(new Dimension(600,30)); |
|
|
|
|
JLabel label2 = new JLabel("<html>"+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") |
|
|
|
|
+ localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+"</html>"); |
|
|
|
|
label2.setPreferredSize(new Dimension(600,30)); |
|
|
|
|
JLabel label3 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); |
|
|
|
|
label3.setPreferredSize(new Dimension(500,20)); |
|
|
|
|
label3.setPreferredSize(new Dimension(500,30)); |
|
|
|
|
|
|
|
|
|
verticalPanel.add(label); |
|
|
|
|
verticalPanel.add(label2); |
|
|
|
@ -73,9 +81,13 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
centerPanel.add(checkArea,BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
//下面的按钮面板
|
|
|
|
|
remindBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remind_Show")); |
|
|
|
|
remindBox.addActionListener(remindCheckboxListener); |
|
|
|
|
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); |
|
|
|
|
JPanel buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
buttonPanel.add(okButton); |
|
|
|
|
JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); |
|
|
|
|
buttonPanel.add(remindBox, BorderLayout.WEST); |
|
|
|
|
buttonPanel.add(okButton,BorderLayout.EAST); |
|
|
|
|
okButton.addActionListener(this ); |
|
|
|
|
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
bottomPanel.add(buttonPanel); |
|
|
|
@ -86,7 +98,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
this.add(topPanel,BorderLayout.NORTH); |
|
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
|
this.add(buttonPanel,BorderLayout.SOUTH); |
|
|
|
|
this.setSize(new Dimension(600, 500)); |
|
|
|
|
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 700:600, 500)); |
|
|
|
|
|
|
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
|
} |
|
|
|
@ -94,4 +106,19 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
this.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ActionListener remindCheckboxListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String remindTime = format.format(new Date()); |
|
|
|
|
//环境已切换,通过当前环境获取,一定是远程环境
|
|
|
|
|
String currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
|
RemoteDesignerWorkspaceInfo currentEnv = (RemoteDesignerWorkspaceInfo)DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentEnvName); |
|
|
|
|
currentEnv.setRemindTime(remindBox.isSelected()? remindTime : ""); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|