Browse Source

REPORT-25003 && REPORT-24491

feature/big-screen
hades 5 years ago
parent
commit
531c7ba284
  1. 17
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  2. 24
      designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java
  3. 30
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

17
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -1,12 +1,17 @@
package com.fr.design.os.impl;
import com.fr.base.FRContext;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
import com.fr.stable.os.Arch;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.SupportOS;
import com.fr.workspace.WorkContext;
import java.util.Locale;
/**
* @author pengda
* @date 2019/10/9
@ -44,10 +49,18 @@ public enum SupportOSImpl implements SupportOS {
@Override
public boolean support() {
boolean isLocalEnv = WorkContext.getCurrent().isLocal();
boolean isChineseEnv = GeneralContext.isChineseEnv();
boolean isLinux = OperatingSystem.isLinux();
// 远程设计和非中文环境以及Linux环境,都不生效
return isLocalEnv && isChineseEnv && !isLinux;
return isLocalEnv && !isLinux && isPushByConf();
}
private boolean isPushByConf() {
String resp = CloudCenter.getInstance().acquireUrlByKind("update.push.conf");
if (StringUtils.isEmpty(resp)) {
return Locale.CHINA.equals(GeneralContext.getLocale());
}
JSONObject jo = new JSONObject(resp);
return jo.optBoolean(GeneralContext.getLocale().toString());
}
},
/**

24
designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java

@ -0,0 +1,24 @@
package com.fr.design.os.impl;
import com.fr.general.GeneralContext;
import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;
import java.util.Locale;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/1/16
*/
public class SupportOSImplTest extends TestCase {
@Test
public void testAutoPush() {
Assert.assertTrue(SupportOSImpl.AUTOPUSHUPDATE.support());
GeneralContext.setLocale(Locale.TAIWAN);
Assert.assertFalse(SupportOSImpl.AUTOPUSHUPDATE.support());
}
}

30
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

@ -645,22 +645,6 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
}
// private JPanel populateWidgetCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Cell"), SwingConstants.LEFT), cellElementVisibleCheckBoxes},
// new Component[]{null, newValue},
// new Component[]{null, valueEditor},
// new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible},
// new Component[]{null, widgetAvailable}
// };
// double[] rowSize = {p, p, p, p, p};
// double[] columnSize = {p, f};
// int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
// }
private JPanel populateWidgetCheckPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
@ -705,20 +689,6 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
// private JPanel populatCellCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{cellElementVisibleCheckBoxes},
// new Component[]{newValue},
// new Component[]{valueEditor}
// };
// double[] rowSize = {p, p, p};
// double[] columnSize = {f};
// int[][] rowCount = {{1}, {1}, {1}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
// }
private JPanel populatCellCheckPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;

Loading…
Cancel
Save