Browse Source

通过当前环境来处理不再依赖于传入对象

feature/big-screen
Maksim 5 years ago
parent
commit
3886e76bbd
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 17
      designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java

2
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -244,7 +244,7 @@ public class EnvChangeEntrance {
textBuilder.append(descriptionOfCN).append("\n"); textBuilder.append(descriptionOfCN).append("\n");
} }
String areaText = textBuilder.toString(); String areaText = textBuilder.toString();
CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), selectedEnv, areaText, localBranch, remoteBranch); CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch);
dialog.setVisible(true); dialog.setVisible(true);
} }
} }

17
designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java

@ -1,6 +1,6 @@
package com.fr.design.write.submit; package com.fr.design.write.submit;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.DesignerEnvManager;
import com.fr.design.env.RemoteDesignerWorkspaceInfo; 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.gui.icheckbox.UICheckBox;
@ -36,11 +36,9 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
private JPanel centerPanel; private JPanel centerPanel;
private JPanel bottomPanel; private JPanel bottomPanel;
private UICheckBox remindBox; private UICheckBox remindBox;
private DesignerWorkspaceInfo selectEnv;
public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ public CheckServiceDialog(Frame parent, 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();
@ -114,15 +112,12 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boolean needRemind = remindBox.isSelected();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String remindTime = format.format(new Date()); String remindTime = format.format(new Date());
if(needRemind){ //环境已切换,通过当前环境获取,一定是远程环境
//前面做过验证,一定是远程环境,直接强转 String currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName();
((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); RemoteDesignerWorkspaceInfo currentEnv = (RemoteDesignerWorkspaceInfo)DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentEnvName);
}else { currentEnv.setRemindTime(remindBox.isSelected()? remindTime : "");
((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime("");
}
} }
}; };

Loading…
Cancel
Save