|
|
|
@ -7,14 +7,12 @@ import com.fr.design.DesignModelAdapter;
|
|
|
|
|
import com.fr.design.bridge.DesignToolbarProvider; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.main.impl.WorkBook; |
|
|
|
|
import com.fr.main.impl.WorkBookHelper; |
|
|
|
|
import com.fr.main.parameter.ReportParameterAttr; |
|
|
|
|
import com.fr.report.cell.CellElement; |
|
|
|
|
import com.fr.report.cell.DefaultTemplateCellElement; |
|
|
|
|
import com.fr.report.cell.FloatElement; |
|
|
|
|
import com.fr.report.elementcase.ElementCase; |
|
|
|
|
import com.fr.report.elementcase.TemplateElementCase; |
|
|
|
|
import com.fr.report.report.Report; |
|
|
|
|
import com.fr.script.Calculator; |
|
|
|
|
import com.fr.stable.Filter; |
|
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.bridge.StableFactory; |
|
|
|
@ -30,6 +28,7 @@ import java.util.List;
|
|
|
|
|
*/ |
|
|
|
|
public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public WorkBookModelAdapter(JWorkBook jworkbook) { |
|
|
|
|
super(jworkbook); |
|
|
|
|
} |
|
|
|
@ -115,27 +114,21 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
|
|
|
|
|
* |
|
|
|
|
* @return widgetName 控件列表. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<WidgetName> getWidgetsName() { |
|
|
|
|
List<WidgetName> list = new ArrayList<WidgetName>(); |
|
|
|
|
WorkBook wb = this.getBook(); |
|
|
|
|
for (int i = 0, len = wb.getReportCount(); i < len; i++) { |
|
|
|
|
Report report = wb.getReport(i); |
|
|
|
|
Iterator it = report.iteratorOfElementCase(); |
|
|
|
|
while (it.hasNext()) { |
|
|
|
|
ElementCase ec = (ElementCase) it.next(); |
|
|
|
|
Iterator cs = ec.cellIterator(); |
|
|
|
|
while (cs.hasNext()) { |
|
|
|
|
CellElement ce = (CellElement) cs.next(); |
|
|
|
|
if (ce instanceof DefaultTemplateCellElement) { |
|
|
|
|
Widget widget = ((DefaultTemplateCellElement) ce).getWidget(); |
|
|
|
|
if (widget != null && StringUtils.isNotEmpty(widget.getWidgetName())) { |
|
|
|
|
list.add(new WidgetName(widget.getWidgetName())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return WorkBookHelper.listWidgetNamesInWorkBook(wb, new Filter<Widget>() { |
|
|
|
|
@Override |
|
|
|
|
public boolean accept(Widget widget) { |
|
|
|
|
return widgetAccepted(widget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return list; |
|
|
|
|
}, new Filter<Widget>() { |
|
|
|
|
@Override |
|
|
|
|
public boolean accept(Widget widget) { |
|
|
|
|
//todo 这边有没有必要统一改成widgetAccepted?暂时不改,插件那边可能会有影响,因为插件有的控件并没有实现DataControl的
|
|
|
|
|
return widget != null && StringUtils.isNotEmpty(widget.getWidgetName()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|