|
|
@ -5,12 +5,17 @@ import com.fr.base.ServerConfig; |
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
|
|
|
import com.fr.design.constants.DesignerLaunchStatus; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
import com.fr.design.fun.DesignerEnvProcessor; |
|
|
|
import com.fr.design.fun.DesignerEnvProcessor; |
|
|
|
import com.fr.design.gui.UILookAndFeel; |
|
|
|
import com.fr.design.gui.UILookAndFeel; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
|
|
|
import com.fr.event.Null; |
|
|
|
import com.fr.exit.DesignerExiter; |
|
|
|
import com.fr.exit.DesignerExiter; |
|
|
|
import com.fr.file.FileFILE; |
|
|
|
import com.fr.file.FileFILE; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
@ -61,12 +66,27 @@ import java.util.concurrent.TimeoutException; |
|
|
|
public class DesignUtils { |
|
|
|
public class DesignUtils { |
|
|
|
private static int port = DesignerPort.getInstance().getMessagePort(); |
|
|
|
private static int port = DesignerPort.getInstance().getMessagePort(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
|
|
|
EventDispatcher.listen(DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE, new Listener<Null>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(Event event, Null aNull) { |
|
|
|
|
|
|
|
checkDesignerEnvMatch(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean started = false; |
|
|
|
private static boolean started = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 设计器和工作目录环境版本是否匹配标志 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private static boolean designerEnvMatch = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DesignUtils() { |
|
|
|
private DesignUtils() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public synchronized static void setPort(int port) { |
|
|
|
public synchronized static void setPort(int port) { |
|
|
|
DesignUtils.port = port; |
|
|
|
DesignUtils.port = port; |
|
|
|
} |
|
|
|
} |
|
|
@ -75,6 +95,10 @@ public class DesignUtils { |
|
|
|
return port; |
|
|
|
return port; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isDesignerEnvMatch() { |
|
|
|
|
|
|
|
return designerEnvMatch; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 判断设计器有没有启动 |
|
|
|
* 判断设计器有没有启动 |
|
|
|
* |
|
|
|
* |
|
|
@ -250,7 +274,6 @@ public class DesignUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void refreshDesignerFrame() { |
|
|
|
public static void refreshDesignerFrame() { |
|
|
|
|
|
|
|
|
|
|
|
// 刷新DesignerFrame里面的面板
|
|
|
|
// 刷新DesignerFrame里面的面板
|
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
|
|
|
|
|
|
|
@ -421,10 +444,10 @@ public class DesignUtils { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void checkDesignerEnvMatch(){ |
|
|
|
public static boolean checkDesignerRemoteVersion() { |
|
|
|
|
|
|
|
if (WorkContext.getCurrent().isLocal()){ |
|
|
|
if (WorkContext.getCurrent().isLocal()){ |
|
|
|
return true; |
|
|
|
designerEnvMatch = true; |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); |
|
|
|
DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); |
|
|
|
DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); |
|
|
@ -435,8 +458,9 @@ public class DesignUtils { |
|
|
|
try { |
|
|
|
try { |
|
|
|
remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); |
|
|
|
remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
return false; |
|
|
|
designerEnvMatch = false; |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
return localBranch.contains("#") && localBranch.equals(remoteBranch); |
|
|
|
designerEnvMatch = localBranch.contains("#") && localBranch.equals(remoteBranch); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|