|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.design.webattr; |
|
|
|
|
|
|
|
|
|
import com.fr.base.ConfigManager; |
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
import com.fr.design.gui.core.WidgetOption; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
@ -12,8 +13,9 @@ import com.fr.form.event.Listener;
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.report.web.ToolBarManager; |
|
|
|
|
import com.fr.report.web.WebContent; |
|
|
|
|
import com.fr.base.ConfigManagerProvider; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.web.attr.ReportWebConfig; |
|
|
|
|
import com.fr.web.attr.ReportWebAttr; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
@ -22,7 +24,7 @@ import java.awt.event.ItemListener;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebConfig> { |
|
|
|
|
public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane<ReportWebAttr> { |
|
|
|
|
private static final String[] CHOOSEITEM = new String[] { |
|
|
|
|
Inter.getLocText("FR-Designer_I_Want_To_Set_Single"), |
|
|
|
|
Inter.getLocText("FR-Designer_Using_Server_Report_View_Settings") |
|
|
|
@ -31,7 +33,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
private EventPane eventPane; |
|
|
|
|
private ToolBarDragPane dragToolBarPane; |
|
|
|
|
private UIComboBox choseComboBox; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final int SINGLE_SET = 0; |
|
|
|
|
private static final int SERVER_SET = 1; |
|
|
|
|
private static final int ZERO = 0; |
|
|
|
@ -117,7 +119,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
protected abstract String[] getEventNames(); |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(ReportWebConfig reportWebAttr) { |
|
|
|
|
public void populateBean(ReportWebAttr reportWebAttr) { |
|
|
|
|
if (reportWebAttr == null || this.getWebContent(reportWebAttr) == null) {// 如果是空值就说明采用服务器配置了
|
|
|
|
|
choseComboBox.removeItemListener(itemListener); |
|
|
|
|
choseComboBox.setSelectedIndex(SERVER_SET); |
|
|
|
@ -145,7 +147,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void update(ReportWebConfig reportWebAttr) { |
|
|
|
|
public void update(ReportWebAttr reportWebAttr) { |
|
|
|
|
if (this.choseComboBox.getSelectedIndex() == SERVER_SET) { |
|
|
|
|
setWebContent(reportWebAttr, null); |
|
|
|
|
reportWebAttr = is_Null_ReportWebAttr(reportWebAttr) ? null : reportWebAttr; |
|
|
|
@ -155,11 +157,11 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public ReportWebConfig updateBean() { |
|
|
|
|
public ReportWebAttr updateBean() { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ReportWebConfig TemplateupdateBean(ReportWebConfig reportWebAttr) { |
|
|
|
|
private ReportWebAttr TemplateupdateBean(ReportWebAttr reportWebAttr) { |
|
|
|
|
T webContent = updateSubWebSettingBean(); |
|
|
|
|
ToolBarManager[] toolBarManagers = dragToolBarPane.updateBean(); |
|
|
|
|
webContent.setToolBarManagers(toolBarManagers); |
|
|
|
@ -171,13 +173,13 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
return reportWebAttr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected abstract T getWebContent(ReportWebConfig reportWebAttr); |
|
|
|
|
protected abstract T getWebContent(ReportWebAttr reportWebAttr); |
|
|
|
|
|
|
|
|
|
protected abstract void populateSubWebSettingrBean(T ob); |
|
|
|
|
|
|
|
|
|
protected abstract T updateSubWebSettingBean(); |
|
|
|
|
|
|
|
|
|
protected abstract void setWebContent(ReportWebConfig reportWebAttr, T ob); |
|
|
|
|
protected abstract void setWebContent(ReportWebAttr reportWebAttr, T ob); |
|
|
|
|
|
|
|
|
|
protected abstract WidgetOption[] getToolBarInstance(); |
|
|
|
|
|
|
|
|
@ -189,7 +191,8 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void populateServerSettings() { |
|
|
|
|
ReportWebConfig reportWebAttr = ReportWebConfig.getInstance(); |
|
|
|
|
ConfigManagerProvider configManager = ConfigManager.getProviderInstance(); |
|
|
|
|
ReportWebAttr reportWebAttr = ((ReportWebAttr)configManager.getGlobalAttribute(ReportWebAttr.class)); |
|
|
|
|
T webContent = this.getWebContent(reportWebAttr); |
|
|
|
|
if(webContent == null){ |
|
|
|
|
return; |
|
|
|
@ -214,7 +217,7 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
|
|
|
|
|
* |
|
|
|
|
* @return 模板web属性书否为空 |
|
|
|
|
*/ |
|
|
|
|
public static boolean is_Null_ReportWebAttr(ReportWebConfig reportWebAttr) { |
|
|
|
|
public static boolean is_Null_ReportWebAttr(ReportWebAttr reportWebAttr) { |
|
|
|
|
if (reportWebAttr == null) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|