|
|
@ -19,7 +19,6 @@ import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.env.CheckServiceDialog; |
|
|
|
import com.fr.env.CheckServiceDialog; |
|
|
|
import com.fr.env.EnvListPane; |
|
|
|
import com.fr.env.EnvListPane; |
|
|
|
import com.fr.exit.DesignerExiter; |
|
|
|
import com.fr.exit.DesignerExiter; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONArray; |
|
|
@ -31,7 +30,6 @@ import com.fr.process.engine.core.CarryMessageEvent; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
|
import com.fr.rpc.Result; |
|
|
|
import com.fr.rpc.Result; |
|
|
|
import com.fr.stable.AssistUtils; |
|
|
|
import com.fr.stable.AssistUtils; |
|
|
|
import com.fr.stable.EnvChangedListener; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.start.server.ServerTray; |
|
|
|
import com.fr.start.server.ServerTray; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
@ -64,8 +62,6 @@ import static javax.swing.JOptionPane.QUESTION_MESSAGE; |
|
|
|
|
|
|
|
|
|
|
|
public class EnvChangeEntrance { |
|
|
|
public class EnvChangeEntrance { |
|
|
|
|
|
|
|
|
|
|
|
private String currentEnvName = ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static EnvChangeEntrance getInstance() { |
|
|
|
public static EnvChangeEntrance getInstance() { |
|
|
|
return HOLDER.singleton; |
|
|
|
return HOLDER.singleton; |
|
|
|
} |
|
|
|
} |
|
|
@ -76,13 +72,7 @@ public class EnvChangeEntrance { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private EnvChangeEntrance() { |
|
|
|
private EnvChangeEntrance() { |
|
|
|
currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
|
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void envChanged() { |
|
|
|
|
|
|
|
currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { |
|
|
|
private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { |
|
|
@ -381,7 +371,7 @@ public class EnvChangeEntrance { |
|
|
|
* 出现对话框,选择使用的工作环境 |
|
|
|
* 出现对话框,选择使用的工作环境 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void chooseEnv() { |
|
|
|
public void chooseEnv() { |
|
|
|
chooseEnv(currentEnvName); |
|
|
|
chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void chooseEnv(final String envName) { |
|
|
|
public void chooseEnv(final String envName) { |
|
|
@ -395,7 +385,7 @@ public class EnvChangeEntrance { |
|
|
|
public void doOk() { |
|
|
|
public void doOk() { |
|
|
|
envListOkAction(envListPane, PopTipStrategy.LATER); |
|
|
|
envListOkAction(envListPane, PopTipStrategy.LATER); |
|
|
|
// 切换完成后清理密码
|
|
|
|
// 切换完成后清理密码
|
|
|
|
updateSelectEnv(envName); |
|
|
|
updateSelectEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -416,7 +406,7 @@ public class EnvChangeEntrance { |
|
|
|
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); |
|
|
|
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); |
|
|
|
} |
|
|
|
} |
|
|
|
final EnvListPane envListPane = new EnvListPane(); |
|
|
|
final EnvListPane envListPane = new EnvListPane(); |
|
|
|
envListPane.populateEnvManager(currentEnvName); |
|
|
|
envListPane.populateEnvManager(DesignerEnvManager.getEnvManager().getCurEnvName()); |
|
|
|
BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); |
|
|
|
BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); |
|
|
|
envListDialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
envListDialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
|
|
|
|
|
|
|
@ -426,7 +416,7 @@ public class EnvChangeEntrance { |
|
|
|
if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { |
|
|
|
if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { |
|
|
|
DesignerExiter.getInstance().execute(); |
|
|
|
DesignerExiter.getInstance().execute(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
updateSelectEnv(currentEnvName); |
|
|
|
updateSelectEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|