|
|
@ -1,13 +1,14 @@ |
|
|
|
package com.fr.design.utils; |
|
|
|
package com.fr.design.utils; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.Env; |
|
|
|
|
|
|
|
import com.fr.base.EnvException; |
|
|
|
import com.fr.base.EnvException; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FeedBackInfo; |
|
|
|
import com.fr.base.FeedBackInfo; |
|
|
|
import com.fr.base.ServerConfig; |
|
|
|
import com.fr.base.ServerConfig; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
|
|
|
|
import com.fr.core.env.EnvConfig; |
|
|
|
|
|
|
|
import com.fr.core.env.EnvContext; |
|
|
|
import com.fr.dav.DavXMLUtils; |
|
|
|
import com.fr.dav.DavXMLUtils; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
@ -30,8 +31,11 @@ import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.start.ServerStarter; |
|
|
|
import com.fr.start.ServerStarter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import java.awt.*; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
|
|
|
import java.awt.Desktop; |
|
|
|
|
|
|
|
import java.awt.Font; |
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.BufferedWriter; |
|
|
|
import java.io.BufferedWriter; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
import java.io.ByteArrayInputStream; |
|
|
@ -183,20 +187,16 @@ public class DesignUtils { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 当前的报表运行环境切换到env |
|
|
|
* 当前的报表运行环境切换到env |
|
|
|
* |
|
|
|
* |
|
|
|
* @param env 需要切换去的环境 |
|
|
|
* @param env 需要切换去的环境 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static void switchToEnv(Env env) { |
|
|
|
public static void switchToEnv(EnvConfig env) { |
|
|
|
if (env == null) { |
|
|
|
if (env == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Env oldEnv = FRContext.getCurrentEnv(); |
|
|
|
|
|
|
|
String oldEnvPath = oldEnv == null ? null : oldEnv.getPath(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 看一下这个env在DesignerEnvManager里面有没有对应的,有的话就setCurrentEnvName
|
|
|
|
// 看一下这个env在DesignerEnvManager里面有没有对应的,有的话就setCurrentEnvName
|
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
java.util.Iterator<String> nameIt = envManager.getEnvNameIterator(); |
|
|
|
java.util.Iterator<String> nameIt = envManager.getEnvNameIterator(); |
|
|
@ -207,14 +207,11 @@ public class DesignUtils { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 更新CurrentEnv于FRContext & DesignerEnvManager
|
|
|
|
EnvContext.signIn(env); |
|
|
|
FRContext.setCurrentEnv(env); |
|
|
|
refreshDesignerFrame(); |
|
|
|
refreshDesignerFrame(env); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void refreshDesignerFrame(Env env) { |
|
|
|
public static void refreshDesignerFrame() { |
|
|
|
|
|
|
|
|
|
|
|
final Env run_env = env; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 刷新DesignerFrame里面的面板
|
|
|
|
// 刷新DesignerFrame里面的面板
|
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
@ -223,7 +220,7 @@ public class DesignUtils { |
|
|
|
if (DesignerContext.getDesignerFrame() == null) { |
|
|
|
if (DesignerContext.getDesignerFrame() == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
DesignerContext.getDesignerFrame().refreshEnv(run_env); |
|
|
|
DesignerContext.getDesignerFrame().refreshEnv(); |
|
|
|
DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变.
|
|
|
|
DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变.
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|