|
|
@ -1,10 +1,14 @@ |
|
|
|
package com.fr.design.write.submit; |
|
|
|
package com.fr.design.write.submit; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
|
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -18,6 +22,9 @@ import java.awt.Dimension; |
|
|
|
import java.awt.Frame; |
|
|
|
import java.awt.Frame; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author: Maksim |
|
|
|
* @author: Maksim |
|
|
@ -28,30 +35,33 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
private JPanel topPanel; |
|
|
|
private JPanel topPanel; |
|
|
|
private JPanel centerPanel; |
|
|
|
private JPanel centerPanel; |
|
|
|
private JPanel bottomPanel; |
|
|
|
private JPanel bottomPanel; |
|
|
|
|
|
|
|
private UICheckBox remindBox; |
|
|
|
|
|
|
|
private DesignerWorkspaceInfo selectEnv; |
|
|
|
|
|
|
|
|
|
|
|
public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ |
|
|
|
public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ |
|
|
|
super(parent,true); |
|
|
|
super(parent,true); |
|
|
|
|
|
|
|
this.selectEnv = selectEnv; |
|
|
|
//上面的标签面板
|
|
|
|
//上面的标签面板
|
|
|
|
topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
JPanel imagePanel = new JPanel(); |
|
|
|
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(); |
|
|
|
JLabel imageLabel = new JLabel(); |
|
|
|
imageLabel.setIcon(icon); |
|
|
|
imageLabel.setIcon(icon); |
|
|
|
imagePanel.add(imageLabel); |
|
|
|
imagePanel.add(imageLabel); |
|
|
|
imagePanel.setPreferredSize(new Dimension(100,80)); |
|
|
|
imagePanel.setPreferredSize(new Dimension(110,80)); |
|
|
|
|
|
|
|
|
|
|
|
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
FRFont font = FRFont.getInstance(); |
|
|
|
FRFont font = FRFont.getInstance(); |
|
|
|
font = font.applySize(15).applyStyle(1); |
|
|
|
font = font.applySize(15).applyStyle(1); |
|
|
|
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); |
|
|
|
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); |
|
|
|
label.setFont(font); |
|
|
|
label.setFont(font); |
|
|
|
label.setPreferredSize(new Dimension(500,30)); |
|
|
|
label.setPreferredSize(new Dimension(600,30)); |
|
|
|
JLabel label2 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") |
|
|
|
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); |
|
|
|
+ localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+"</html>"); |
|
|
|
label2.setPreferredSize(new Dimension(500,20)); |
|
|
|
label2.setPreferredSize(new Dimension(600,30)); |
|
|
|
JLabel label3 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); |
|
|
|
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(label); |
|
|
|
verticalPanel.add(label2); |
|
|
|
verticalPanel.add(label2); |
|
|
@ -73,9 +83,13 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
centerPanel.add(checkArea,BorderLayout.CENTER); |
|
|
|
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")); |
|
|
|
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); |
|
|
|
JPanel buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
buttonPanel.add(okButton); |
|
|
|
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); |
|
|
|
|
|
|
|
buttonPanel.add(remindBox, BorderLayout.WEST); |
|
|
|
|
|
|
|
buttonPanel.add(okButton,BorderLayout.EAST); |
|
|
|
okButton.addActionListener(this ); |
|
|
|
okButton.addActionListener(this ); |
|
|
|
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
bottomPanel.add(buttonPanel); |
|
|
|
bottomPanel.add(buttonPanel); |
|
|
@ -86,7 +100,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
this.add(topPanel,BorderLayout.NORTH); |
|
|
|
this.add(topPanel,BorderLayout.NORTH); |
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
this.add(buttonPanel,BorderLayout.SOUTH); |
|
|
|
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); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
} |
|
|
|
} |
|
|
@ -94,4 +108,22 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
this.dispose(); |
|
|
|
this.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ActionListener remindCheckboxListener = new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
boolean needRemind = remindBox.isSelected(); |
|
|
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
String remindTime = format.format(new Date()); |
|
|
|
|
|
|
|
if(needRemind){ |
|
|
|
|
|
|
|
//前面做过验证,一定是远程环境,直接强转
|
|
|
|
|
|
|
|
((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|