|
|
|
@ -6,7 +6,6 @@ import com.fr.concurrent.NamedThreadFactory;
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
|
import com.fr.design.fun.DesignerEnvProcessor; |
|
|
|
|
import com.fr.design.gui.UILookAndFeel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
@ -16,19 +15,20 @@ import com.fr.file.FileFILE;
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.general.FRFont; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.general.GeneralUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.rpc.ExceptionHandler; |
|
|
|
|
import com.fr.rpc.RPCInvokerExceptionInfo; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
import com.fr.stable.CommonCodeUtils; |
|
|
|
|
import com.fr.stable.EnvChangedListener; |
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.os.OperatingSystem; |
|
|
|
|
import com.fr.start.ServerStarter; |
|
|
|
|
import com.fr.value.NotNullLazyValue; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.server.predefined.PredefinedStyleOperator; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import java.awt.Desktop; |
|
|
|
@ -69,6 +69,16 @@ public class DesignUtils {
|
|
|
|
|
private static boolean designerEnvMatch = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
|
|
@Override |
|
|
|
|
public void envChanged() { |
|
|
|
|
designerEnvMatch = checkDesignerEnvMatch(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DesignUtils() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -429,26 +439,17 @@ public class DesignUtils {
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* check下设计器jar包版本和当前envjar包版本是否匹配,设计器启动后和环境切换成功后调用 |
|
|
|
|
*/ |
|
|
|
|
public static void checkDesignerEnvMatch(){ |
|
|
|
|
if (WorkContext.getCurrent().isLocal()){ |
|
|
|
|
designerEnvMatch = true; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
|
DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); |
|
|
|
|
String localBranch; |
|
|
|
|
String remoteBranch; |
|
|
|
|
WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); |
|
|
|
|
localBranch = GeneralUtils.readFullBuildNO(); |
|
|
|
|
try { |
|
|
|
|
remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
designerEnvMatch = false; |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
public static boolean checkDesignerEnvMatch() { |
|
|
|
|
if (WorkContext.getCurrent().isLocal()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
designerEnvMatch = localBranch.contains("#") && localBranch.equals(remoteBranch); |
|
|
|
|
return WorkContext.getCurrent().get(PredefinedStyleOperator.class, new ExceptionHandler() { |
|
|
|
|
@Override |
|
|
|
|
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { |
|
|
|
|
FineLoggerFactory.getLogger().error(exceptionInfo.getException().getMessage(), exceptionInfo.getException()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}).allowPredefinedSetting(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|