|
|
@ -5,6 +5,7 @@ import com.fr.base.PaperSize; |
|
|
|
import com.fr.base.Parameter; |
|
|
|
import com.fr.base.Parameter; |
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
import com.fr.base.vcs.DesignerMode; |
|
|
|
|
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
import com.fr.design.DesignState; |
|
|
|
import com.fr.design.DesignState; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.actions.FormMobileAttrAction; |
|
|
|
import com.fr.design.actions.FormMobileAttrAction; |
|
|
@ -13,6 +14,7 @@ import com.fr.design.actions.core.WorkBookSupportable; |
|
|
|
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; |
|
|
|
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; |
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
import com.fr.design.cell.FloatElementsProvider; |
|
|
|
import com.fr.design.cell.FloatElementsProvider; |
|
|
|
|
|
|
|
import com.fr.design.data.datapane.TableDataTreePane; |
|
|
|
import com.fr.design.designer.TargetComponent; |
|
|
|
import com.fr.design.designer.TargetComponent; |
|
|
|
import com.fr.design.designer.beans.actions.CopyAction; |
|
|
|
import com.fr.design.designer.beans.actions.CopyAction; |
|
|
|
import com.fr.design.designer.beans.actions.CutAction; |
|
|
|
import com.fr.design.designer.beans.actions.CutAction; |
|
|
@ -29,6 +31,7 @@ import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; |
|
|
|
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; |
|
|
|
import com.fr.design.event.TargetModifiedEvent; |
|
|
|
import com.fr.design.event.TargetModifiedEvent; |
|
|
|
import com.fr.design.event.TargetModifiedListener; |
|
|
|
import com.fr.design.event.TargetModifiedListener; |
|
|
|
|
|
|
|
import com.fr.design.fun.FormAdaptiveConfigUIProcessor; |
|
|
|
import com.fr.design.fun.PreviewProvider; |
|
|
|
import com.fr.design.fun.PreviewProvider; |
|
|
|
import com.fr.design.fun.PropertyItemPaneProvider; |
|
|
|
import com.fr.design.fun.PropertyItemPaneProvider; |
|
|
|
import com.fr.design.gui.frpane.HyperlinkGroupPane; |
|
|
|
import com.fr.design.gui.frpane.HyperlinkGroupPane; |
|
|
@ -125,6 +128,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
//FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示
|
|
|
|
//FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示
|
|
|
|
protected int index = FORM_TAB; |
|
|
|
protected int index = FORM_TAB; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private PluginEventListener pluginListener; |
|
|
|
|
|
|
|
|
|
|
|
public JForm() { |
|
|
|
public JForm() { |
|
|
|
super(new Form(new WBorderLayout("form")), "Form"); |
|
|
|
super(new Form(new WBorderLayout("form")), "Form"); |
|
|
|
|
|
|
|
|
|
|
@ -132,6 +137,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
startListenPlugin(); |
|
|
|
startListenPlugin(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JForm(Form form, FILE file) { |
|
|
|
public JForm(Form form, FILE file) { |
|
|
|
super(form, file); |
|
|
|
super(form, file); |
|
|
|
|
|
|
|
|
|
|
@ -147,18 +153,18 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
return context.contain(PropertyItemPaneProvider.XML_TAG); |
|
|
|
return context.contain(PropertyItemPaneProvider.XML_TAG); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, |
|
|
|
this.pluginListener = new PluginEventListener(PropertyItemPaneProvider.LAST) { |
|
|
|
new PluginEventListener(PropertyItemPaneProvider.LAST) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void on(PluginEvent event) { |
|
|
|
public void on(PluginEvent event) { |
|
|
|
PluginContext context = event.getContext(); |
|
|
|
PluginContext context = event.getContext(); |
|
|
|
PluginRuntime runtime = context.getRuntime(); |
|
|
|
PluginRuntime runtime = context.getRuntime(); |
|
|
|
Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG); |
|
|
|
Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG); |
|
|
|
for (PropertyItemPaneProvider provider : providers) { |
|
|
|
for (PropertyItemPaneProvider provider : providers) { |
|
|
|
addPane(provider); |
|
|
|
addPane(provider); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}, filter); |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginListener, filter); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPluginPane() { |
|
|
|
private void initPluginPane() { |
|
|
@ -203,12 +209,14 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public TemplateProcessInfo<Form> getProcessInfo() { |
|
|
|
public TemplateProcessInfo<Form> getProcessInfo() { |
|
|
|
|
|
|
|
//这边需要判空,图表的埋点信息收集时可能没有初始化processInfo
|
|
|
|
if (processInfo == null) { |
|
|
|
if (processInfo == null) { |
|
|
|
processInfo = new JFormProcessInfo(template); |
|
|
|
processInfo = new JFormProcessInfo(template); |
|
|
|
} |
|
|
|
} |
|
|
|
return processInfo; |
|
|
|
return processInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public FormECCompositeProvider getReportComposite() { |
|
|
|
public FormECCompositeProvider getReportComposite() { |
|
|
|
return this.reportComposite; |
|
|
|
return this.reportComposite; |
|
|
|
} |
|
|
|
} |
|
|
@ -559,12 +567,21 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public ShortCut[] shortcut4TemplateMenu() { |
|
|
|
public ShortCut[] shortcut4TemplateMenu() { |
|
|
|
if (this.index == FORM_TAB) { |
|
|
|
if (this.index == FORM_TAB) { |
|
|
|
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), new ReportFitAttrAction(this)}, new ShortCut[0]); |
|
|
|
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), getReportFitAttrAction()}, new ShortCut[0]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), new ReportFitAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu()); |
|
|
|
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), getReportFitAttrAction()}, this.elementCaseDesign.shortcut4TemplateMenu()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ShortCut getReportFitAttrAction() { |
|
|
|
|
|
|
|
FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); |
|
|
|
|
|
|
|
if (adaptiveConfigUI != null) { |
|
|
|
|
|
|
|
return adaptiveConfigUI.getConfigShortCut(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new ReportFitAttrAction(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 权限细粒度模板菜单 |
|
|
|
* 权限细粒度模板菜单 |
|
|
|
* 表单中去掉此菜单项 |
|
|
|
* 表单中去掉此菜单项 |
|
|
@ -644,6 +661,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
//下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC
|
|
|
|
//下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC
|
|
|
|
formDesign.setElementCase(dataTable); |
|
|
|
formDesign.setElementCase(dataTable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView(); |
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
@ -872,6 +890,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
* @param index 切换位置 |
|
|
|
* @param index 切换位置 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void tabChanged(int index) { |
|
|
|
public void tabChanged(int index) { |
|
|
|
|
|
|
|
this.index = index; |
|
|
|
if (index == ELEMENTCASE_TAB) { |
|
|
|
if (index == ELEMENTCASE_TAB) { |
|
|
|
formDesign.setReportBlockEditing(true); |
|
|
|
formDesign.setReportBlockEditing(true); |
|
|
|
ecTabAction(); |
|
|
|
ecTabAction(); |
|
|
@ -879,7 +898,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
formDesign.setReportBlockEditing(false); |
|
|
|
formDesign.setReportBlockEditing(false); |
|
|
|
formTabAction(); |
|
|
|
formTabAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.index = index; |
|
|
|
|
|
|
|
refreshToolArea(); |
|
|
|
refreshToolArea(); |
|
|
|
this.cardLayout.show(tabCenterPane, CARDNAME[index]); |
|
|
|
this.cardLayout.show(tabCenterPane, CARDNAME[index]); |
|
|
|
if (elementCaseDesign != null && index == ELEMENTCASE_TAB) { |
|
|
|
if (elementCaseDesign != null && index == ELEMENTCASE_TAB) { |
|
|
@ -1022,4 +1040,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F |
|
|
|
// richer:form文件 daniel 改成三个字
|
|
|
|
// richer:form文件 daniel 改成三个字
|
|
|
|
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); |
|
|
|
fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void whenClose() { |
|
|
|
|
|
|
|
// stop的时候 pluginListener 和 PluginFilter 都会移除
|
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().stopListen(this.pluginListener); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|