|
|
|
@ -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(); |
|
|
|
|
} |
|
|
|
|
} |