Browse Source

frm控件移动端属性删除插件监听逻辑

feature/x
obo 12 months ago
parent
commit
e7e1fc0d00
  1. 33
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java

33
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStylePane.java

@ -44,8 +44,6 @@ public class MobileStylePane extends BasicPane {
private JList styleList;
private Map<String, BasicBeanPane<MobileStyle>> map = new HashMap<>();
private boolean checkFlag = true;
public MobileStylePane(Widget widget) {
if (widget instanceof WScaleLayout) {
this.widget = ((CRBoundsWidget) ((WScaleLayout) widget).getBoundsWidget()).getWidget();
@ -82,7 +80,6 @@ public class MobileStylePane extends BasicPane {
private void init() {
initComponent();
initPluginListener();
}
private void initComponent() {
@ -131,7 +128,7 @@ public class MobileStylePane extends BasicPane {
listModel.addElement(displayName);
try {
BasicBeanPane<MobileStyle> mobileStyleBasicBeanPane = new MobileStyleDefinePane(widget, appearanceClazz, mobileStyleClazz);
if (checkFlag && WidgetThemeMobileStyleDefinePaneCreator.createBaseBeanPane(widget, appearanceClazz, mobileStyleClazz) != null) {
if (WidgetThemeMobileStyleDefinePaneCreator.createBaseBeanPane(widget, appearanceClazz, mobileStyleClazz) != null) {
mobileStyleBasicBeanPane = WidgetThemeMobileStyleDefinePaneCreator.createBaseBeanPane(widget, appearanceClazz, mobileStyleClazz);
Class<? extends MobileCommonExtraStyle> extraStyle = WidgetThemeMobileStyleDefinePaneCreator.classForCommonExtraStyle(widget);
if (extraStyle != null) {
@ -164,32 +161,4 @@ public class MobileStylePane extends BasicPane {
return styleProviders;
}
private void initPluginListener() {
EventDispatcher.listen(PluginEventType.AfterRun, new Listener<PluginContext>() {
@Override
public void on(Event event, PluginContext pluginContext) {
if (pluginContext.getRuntime().contain(MobileStyleDefinePaneCreator.XML_TAG)) {
checkFlag = true;
refreshDockingView();
}
}
});
EventDispatcher.listen(PluginEventType.BeforeStop, new Listener<PluginContext>() {
@Override
public void on(Event event, PluginContext pluginContext) {
if (pluginContext.getRuntime().contain(MobileStyleDefinePaneCreator.XML_TAG)) {
checkFlag = false;
refreshDockingView();
}
}
});
}
private void refreshDockingView() {
removeAll();
initComponent();
populate(widget.getMobileStyle());
this.updateUI();
this.repaint();
}
}
Loading…
Cancel
Save