|
|
|
@ -20,6 +20,7 @@ import com.fr.form.ui.ChartEditor;
|
|
|
|
|
import com.fr.form.ui.Label; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
|
|
|
|
|
import com.fr.form.ui.container.WBorderLayout; |
|
|
|
|
import com.fr.form.ui.container.WScaleLayout; |
|
|
|
|
import com.fr.form.ui.container.WTitleLayout; |
|
|
|
|
import com.fr.form.ui.widget.CRBoundsWidget; |
|
|
|
@ -74,22 +75,21 @@ public class SearchWidgetFormulaAction extends AbstractSearchWidgetFormulaAction
|
|
|
|
|
|
|
|
|
|
private void searchFormulaFromWidgetValue(Info info, List<FormulaInfo> formulaInfos) { |
|
|
|
|
Widget widget = (Widget) info.getContent().getReplaceObject(); |
|
|
|
|
|
|
|
|
|
if (widget instanceof WScaleLayout) { |
|
|
|
|
widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget(); |
|
|
|
|
info.getContent().setReplaceObject(widget); |
|
|
|
|
} |
|
|
|
|
if (widget instanceof WTitleLayout) { |
|
|
|
|
if (((WTitleLayout) widget).getTitleBoundsWidget() != null){ |
|
|
|
|
if (((WTitleLayout) widget).getTitleBoundsWidget() != null) { |
|
|
|
|
CRBoundsWidget boundsWidget = ((WTitleLayout) widget).getTitleBoundsWidget(); |
|
|
|
|
if (boundsWidget.getWidget() instanceof Label){ |
|
|
|
|
if (boundsWidget.getWidget() instanceof Label) { |
|
|
|
|
ITContent titleContent = ITContent.copy(info.getContent()); |
|
|
|
|
titleContent.setReplaceObject(((Label) boundsWidget.getWidget()).getWidgetValue().getValue()); |
|
|
|
|
formulaInfos.add(new FormulaInfo(titleContent)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Widget tempWidget = (((WTitleLayout) widget).getBodyBoundsWidget()).getWidget(); |
|
|
|
|
if (tempWidget instanceof ChartEditor && ((ChartEditor) tempWidget).getChartCollection() instanceof ChartCollection) { |
|
|
|
|
if (isChartValid(tempWidget)) { |
|
|
|
|
SearchChartCollectionFormulaAction.getInstance().searchChartCollectionFormula(formulaInfos, info.getContent(), (ChartCollection) ((ChartEditor) tempWidget).getChartCollection()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -102,6 +102,9 @@ public class SearchWidgetFormulaAction extends AbstractSearchWidgetFormulaAction
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isChartValid(Widget tempWidget) { |
|
|
|
|
return tempWidget instanceof ChartEditor && ((ChartEditor) tempWidget).getChartCollection() instanceof ChartCollection; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean isReplaceObjectExist(Info info) { |
|
|
|
|
return info.getContent() != null && info.getContent().getReplaceObject() != null; |
|
|
|
|