Browse Source

Pull request #1651: REPORT-30557 【10.0.6】设计器启动类替换接口

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '3e2daccbbc6e164112323f606258a7a2e33fbcc2':
  REPORT-30557 fix name
  REPORT-30557 fix name
  REPORT-30557 【10.0.6】设计器启动类替换接口
feature/big-screen
Hades 5 years ago
parent
commit
fb17463232
  1. 23
      designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java
  2. 23
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java
  3. 12
      designer-realize/src/main/java/com/fr/start/DesignerInitial.java

23
designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java

@ -0,0 +1,23 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Mutable;
import com.fr.start.BaseDesigner;
/**
* 设计器启动类替换接口
*
* @author hades
* @version 10.0
* Created by hades on 2020/5/7
*/
public interface DesignerStartClassProcessor extends Mutable {
String MARK_STRING = "DesignerStartClassProcessor";
int CURRENT_LEVEL = 1;
Class<? extends BaseDesigner> transform();
}

23
designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java

@ -0,0 +1,23 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.DesignerStartClassProcessor;
import com.fr.stable.fun.mark.API;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/5/7
*/
@API(level = DesignerStartClassProcessor.CURRENT_LEVEL)
public abstract class AbstractDesignerStartClassProcessorProcessor implements DesignerStartClassProcessor {
@Override
public String mark4Provider() {
return getClass().getName();
}
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
}

12
designer-realize/src/main/java/com/fr/start/DesignerInitial.java

@ -1,12 +1,15 @@
package com.fr.start;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.fun.DesignerStartClassProcessor;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.event.Null;
import com.fr.invoke.Reflect;
import com.fr.stable.bridge.StableFactory;
/**
* Created by juhaoyu on 2019-06-14.
@ -14,13 +17,18 @@ import com.fr.event.Null;
*/
public class DesignerInitial {
private static volatile MainDesigner designer;
private static volatile BaseDesigner designer;
public static void init(final String... args) {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
designer = new MainDesigner(args);
DesignerStartClassProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerStartClassProcessor.MARK_STRING, DesignerStartClassProcessor.class);
if (processor != null) {
designer = Reflect.on(processor.transform()).create(args).get();
} else {
designer = new MainDesigner(args);
}
}
});
}

Loading…
Cancel
Save