kuangshuai
4 years ago
6 changed files with 58 additions and 32 deletions
@ -1,16 +0,0 @@ |
|||||||
package com.fr.design.share; |
|
||||||
|
|
||||||
import com.fr.design.base.clipboard.ClipboardFilter; |
|
||||||
import com.fr.design.mainframe.share.collect.SharableCollectorManager; |
|
||||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; |
|
||||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; |
|
||||||
import com.fr.design.mainframe.share.util.SharableXMLUtils; |
|
||||||
|
|
||||||
public class SharableInitManager { |
|
||||||
public static void start() { |
|
||||||
SharableXMLUtils.registerSharableReadHelper(); |
|
||||||
SharableCollectorManager.getInstance().execute(); |
|
||||||
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); |
|
||||||
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,49 @@ |
|||||||
|
package com.fr.design.share; |
||||||
|
|
||||||
|
import com.fr.design.base.clipboard.ClipboardFilter; |
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.designer.creator.XLayoutContainer; |
||||||
|
import com.fr.design.mainframe.JForm; |
||||||
|
import com.fr.design.mainframe.JTemplate; |
||||||
|
import com.fr.design.mainframe.share.collect.ComponentCollector; |
||||||
|
import com.fr.design.mainframe.share.collect.SharableCollectorManager; |
||||||
|
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; |
||||||
|
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; |
||||||
|
import com.fr.design.mainframe.share.util.SharableXMLUtils; |
||||||
|
import com.fr.design.mainframe.share.util.ShareComponentUtils; |
||||||
|
import com.fr.design.share.utils.EffectItemUtils; |
||||||
|
import com.fr.json.JSONArray; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class SharableManager { |
||||||
|
public static void start() { |
||||||
|
SharableXMLUtils.registerSharableReadHelper(); |
||||||
|
SharableCollectorManager.getInstance().execute(); |
||||||
|
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); |
||||||
|
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); |
||||||
|
} |
||||||
|
|
||||||
|
public static void saveTemplate(JTemplate jt) { |
||||||
|
if (jt instanceof JForm) { |
||||||
|
int showCount = 0; |
||||||
|
int useCount = 0; |
||||||
|
if (!jt.getProcessInfo().isTestTemplate()) { |
||||||
|
JForm jForm = (JForm) jt; |
||||||
|
XLayoutContainer root = jForm.getFormDesign().getRootComponent(); |
||||||
|
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root); |
||||||
|
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID()); |
||||||
|
for (XCreator xCreator : xCreators) { |
||||||
|
if (EffectItemUtils.hasEffectItem(xCreator.toData())) { |
||||||
|
showCount ++; |
||||||
|
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) { |
||||||
|
useCount++; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue