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