You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
4.0 KiB
110 lines
4.0 KiB
package com.fr.design.webattr; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
import com.fr.design.gui.core.WidgetOption; |
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.report.web.ToolBarManager; |
|
import com.fr.report.web.WebView; |
|
import com.fr.web.attr.ReportWebAttr; |
|
|
|
import javax.swing.JPanel; |
|
import java.util.ArrayList; |
|
import java.util.Arrays; |
|
import java.util.List; |
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
import static com.fine.swing.ui.layout.Layouts.fix; |
|
|
|
public class ViewWebSettingPane extends WebSettingPane<WebView> { |
|
private UICheckBox sortCheckBox; |
|
private UICheckBox conditionFilterBox; |
|
private UICheckBox listFilterBox; |
|
|
|
public ViewWebSettingPane() { |
|
super(); |
|
} |
|
|
|
/** |
|
* 模板-模板Web属性-数据分析设置中其余设置面板,通用部分在父类绘制 |
|
* @return |
|
*/ |
|
@Override |
|
protected JPanel createOtherSetPane() { |
|
sortCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Sort_Sort")); |
|
conditionFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Selection_Filter")); |
|
listFilterBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_List_Filter")); |
|
sortCheckBox.setSelected(true); |
|
conditionFilterBox.setSelected(true); |
|
listFilterBox.setSelected(true); |
|
return row( |
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview"))).weight(0.15), |
|
row(cell(sortCheckBox), fix(12), cell(conditionFilterBox), fix(12), cell(listFilterBox), flex()).weight(0.85) |
|
).getComponent(); |
|
} |
|
|
|
@Override |
|
protected void populateSubWebSettingrBean(WebView ob) { |
|
if (ob == null) { |
|
ob = new WebView(); |
|
} |
|
listFilterBox.setSelected(ob.isListFuncCheck()); |
|
conditionFilterBox.setSelected(ob.isConditionFuncCheck()); |
|
sortCheckBox.setSelected(ob.isSortFuncCheck()); |
|
} |
|
|
|
@Override |
|
protected WebView updateSubWebSettingBean() { |
|
WebView webView = new WebView(); |
|
webView.setListFuncCheck(listFilterBox.isSelected()); |
|
webView.setConditionFuncCheck(conditionFilterBox.isSelected()); |
|
webView.setSortFuncCheck(sortCheckBox.isSelected()); |
|
return webView; |
|
} |
|
|
|
@Override |
|
protected WidgetOption[] getToolBarInstance() { |
|
List<WidgetOption> defaultOptions = Arrays.asList(ReportWebWidgetConstants.getViewToolBarInstance()); |
|
List<WidgetOption> extraOptions = Arrays.asList(ExtraDesignClassManager.getInstance().getWebWidgetOptions()); |
|
List<WidgetOption> options = new ArrayList<WidgetOption>(); |
|
options.addAll(defaultOptions); |
|
options.addAll(extraOptions); |
|
return options.toArray(new WidgetOption[options.size()]); |
|
} |
|
|
|
@Override |
|
protected ToolBarManager getDefaultToolBarManager() { |
|
return ToolBarManager.createDefaultViewToolBar(); |
|
} |
|
|
|
@Override |
|
protected WebView getWebContent(ReportWebAttr reportWebAttr) { |
|
return reportWebAttr == null ? null : reportWebAttr.getWebView(); |
|
} |
|
|
|
@Override |
|
protected String[] getEventNames() { |
|
return new WebView().supportedEvents(); |
|
} |
|
|
|
@Override |
|
protected void setWebContent(ReportWebAttr reportWebAttr, WebView webContent) { |
|
reportWebAttr.setWebView(webContent); |
|
} |
|
@Override |
|
protected void checkEnabled(boolean isSelected) { |
|
super.checkEnabled(isSelected); |
|
sortCheckBox.setEnabled(isSelected); |
|
conditionFilterBox.setEnabled(isSelected); |
|
listFilterBox.setEnabled(isSelected); |
|
} |
|
protected void setDefault(){ |
|
super.setDefault(); |
|
sortCheckBox.setSelected(true); |
|
conditionFilterBox.setSelected(true); |
|
listFilterBox.setSelected(true); |
|
} |
|
}
|
|
|