Browse Source

REPORT-36778 【配合平台】版本号规范FR适配任务

feature/big-screen
Henry.Wang 4 years ago
parent
commit
dbb5070ad3
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 21
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java
  4. 8
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  5. 7
      designer-base/src/main/java/com/fr/env/CheckServiceDialog.java

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

@ -236,7 +236,7 @@ public class EnvChangeEntrance {
//说明版本一致,仅做日志记录
FineLoggerFactory.getLogger().info("Remote Designer version consistency");
} else {
localBranch = formatBranch(localBranch);
localBranch = GeneralUtils.getVersion();
remoteBranch = formatBranch(remoteBranch);
Set<Class> noExistServiceSet = getNoExistServiceSet(connectionInfo);
StringBuilder textBuilder = new StringBuilder();

21
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -11,8 +11,10 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
@ -36,14 +38,16 @@ public class AboutPane extends JPanel {
private static final String BUILD_PREFIX = " ";
private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("help.compNo");
private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("help.PNo");
private static final String LEFT_BRACKET = "(";
private static final String RIGHT_BRACKET = ")";
private int maxWidth;
public AboutPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.maxWidth = GraphHelper.getWidth(getBuildTitle() + GeneralUtils.readFullBuildNO() +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK"));
this.maxWidth = GraphHelper.getWidth(getBuildTitle() + getVersionBuildNO() +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK"));
//center panel
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(centerPane, BorderLayout.CENTER);
@ -53,7 +57,7 @@ public class AboutPane extends JPanel {
BoxCenterAlignmentCopyablePane buildCopyPane = new BoxCenterAlignmentCopyablePane(
getBuildTitle(),
GeneralUtils.readFullBuildNO(),
getVersionBuildNO(),
new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK")
@ -95,6 +99,15 @@ public class AboutPane extends JPanel {
}
}
public String getVersionBuildNO() {
String version = GeneralUtils.getVersion();
String build = GeneralUtils.readFullBuildNO();
String notInstalledVersion = InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build");
if (ComparatorUtils.equals(notInstalledVersion, build))
return notInstalledVersion;
return version + LEFT_BRACKET + build + RIGHT_BRACKET;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(this.maxWidth, super.getPreferredSize().height);

5
designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java

@ -24,6 +24,8 @@ public class RecoverForDesigner implements Recover {
private final String installHome = StableUtils.getInstallHome();
private static final String HYPHEN = "-";
@Override
public boolean recover() {
try{
@ -41,7 +43,8 @@ public class RecoverForDesigner implements Recover {
@Override
public boolean backup() {
//jar包备份文件的目录为"backup/"+jar包当前版本号
String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO()));
String versionBuildNo = GeneralUtils.getVersion() + HYPHEN + GeneralUtils.readBuildNO();
String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, versionBuildNo);
String envHome = ProjectLibrary.getInstance().getLibHome();
backupFilesFromInstallEnv(envHome, todayBackupDir);
backupFilesFromInstallLib(installHome, todayBackupDir);

8
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -29,6 +29,7 @@ import com.fr.general.*;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray;
import com.fr.json.JSONObject;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.process.engine.core.FineProcessEngineEvent;
@ -80,6 +81,8 @@ public class UpdateMainDialog extends UIDialog {
private static final String UPDATE_CACHE_STATE_FAIL = "fail";
private static final String UPDATE_CACHE_STATE_SUCCESS = "success";
private static final String HYPHEN = "-";
private final SimpleDateFormat CHANGELOG_FORMAT = new SimpleDateFormat("M/d/y, h:m:s a", Locale.ENGLISH);
private final SimpleDateFormat UPDATE_INFO_TABLE_FORMAT = new SimpleDateFormat("yyyy.MM.dd");
@ -303,8 +306,9 @@ public class UpdateMainDialog extends UIDialog {
new UILabel(UpdateConstants.DEFAULT_APP_NAME + StringUtils.BLANK + ProductConstants.VERSION)
);
jarCurrentLabel = new UILabel(StringUtils.isEmpty(GeneralUtils.readBuildNO()) ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Not_Install_Version") : GeneralUtils.readBuildNO(), SwingConstants.CENTER);
String notInstallVersion = InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build");
String versionBuildNo = GeneralUtils.getVersion() + HYPHEN + GeneralUtils.readBuildNO();
jarCurrentLabel = new UILabel(ComparatorUtils.equals(notInstallVersion, GeneralUtils.readBuildNO()) ? notInstallVersion : versionBuildNo, SwingConstants.CENTER);
UILabel noJarPreviousRevision = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_No_Previous_Version"));
UpdateActionLabel jarRestorePreviousRevision = new UpdateActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Restore"), false);
jarRestorePreviousRevision.setForeground(new Color(RESTORE_LABEL_COLOR));

7
designer-base/src/main/java/com/fr/env/CheckServiceDialog.java vendored

@ -59,10 +59,13 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
label.setPreferredSize(new Dimension(650,30));
String text = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + localBranch
+ Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch;
+ Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") +
Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") +
localBranch;
String delimiter = DisplayUtils.getDisplayLength(text) > 70? "<br>":"/";
JLabel label2 = new JLabel("<html>"+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer")
+ localBranch + delimiter + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+"</html>");
+ localBranch + delimiter + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") +
Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old")+ localBranch +"</html>");
label2.setPreferredSize(new Dimension(600,30));
JTextPane tipsPane = new JTextPane();

Loading…
Cancel
Save