Browse Source

REPORT-113994 【NewUI】新增UI开发者选项

newui
Levy.Xie-解安森 4 months ago
parent
commit
4462b3258b
  1. 14
      designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  3. 14
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

14
designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java

@ -9,13 +9,18 @@ import com.fr.general.ComparatorUtils;
*/
public class DesignerUIModeConfig {
private DesignerUIMode mode = AbsoluteMeasureUIMode.getInstance();
private boolean uiDevMode = false;
private static class DesignerUIModeConfigHolder {
private static final DesignerUIModeConfig designerUIModeConfig = new DesignerUIModeConfig();
}
private DesignerUIModeConfig() {
init();
}
private void init() {
uiDevMode = Boolean.parseBoolean(System.getProperty("uiDevMode", "false"));
}
public static DesignerUIModeConfig getInstance() {
@ -32,6 +37,15 @@ public class DesignerUIModeConfig {
return ComparatorUtils.equals(SimulateWebUIMode.getInstance(), mode);
}
/**
* 判断是否是ui开发者模式
*
* @return boolean
*/
public boolean isUIDevMode() {
return uiDevMode;
}
/**
* 设置新ui模式
*/

6
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -57,6 +57,7 @@ import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIMenuBar;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.locale.impl.SupportLocaleImpl;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.platform.ServicePlatformAction;
import com.fr.design.menu.MenuDef;
@ -295,7 +296,10 @@ public abstract class ToolBarMenuDock {
}
}, SupportLocaleImpl.COMMUNITY);
menuList.add(createLookAndFeel());
// 当前仅UI开发者模式显示外观配置选项
if (DesignerUIModeConfig.getInstance().isUIDevMode()) {
menuList.add(createLookAndFeel());
}
// 添加全部UpdateAction到actionmanager中
addAllUpdateActionsToList(menuList);

14
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -30,6 +30,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.InformationCollector;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JWorkBook;
@ -158,9 +159,18 @@ public class MainDesigner extends BaseDesigner {
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
DesignerStartupContext.getRecorder().stop();
SwitchForSwingChecker.initThreadMonitoring();
// new UiInspector();
// EdtInvocationManager.installEDTCheckers();
DesignerLatencyMetric.getInstance().start();
installUIDevModeTools();
}
/**
* 进入UI开发者模式
*/
private static void installUIDevModeTools() {
if (DesignerUIModeConfig.getInstance().isUIDevMode()) {
new UiInspector();
}
}
/**

Loading…
Cancel
Save