Browse Source

REPORT-3163 合作开发9.0设计器=>条件属性=》整合框架

master
plough 8 years ago
parent
commit
c9d9d60b6e
  1. 2
      designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
  2. 30
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 20
      designer/src/com/fr/design/present/ConditionAttributesGroupPane.java
  4. 8
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

2
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java

@ -24,7 +24,7 @@ public class ConditionAttributesAction extends AbstractCellElementAction {
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
ConditionAttributesGroupPane pane = new ConditionAttributesGroupPane();
ConditionAttributesGroupPane pane = ConditionAttributesGroupPane.getInstance();
pane.populate(cellElement.getHighlightGroup());
return pane;

30
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -4,8 +4,11 @@ import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.DesignState;
@ -23,6 +26,10 @@ import com.fr.design.event.TargetModifiedListener;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
@ -58,18 +65,23 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
// 模板初始化完成后,才能初始化超级链接面板
// HyperlinkGroupPane hyperlinkGroupPane = ReportHyperlinkGroupPane.getInstance(HyperlinkGroupPaneActionImpl.getInstance());
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) {
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
// EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceFloatElementPane(QuickEditorRegion.getInstance());
} else {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(getEditingCellElement((CellSelection)editingSelection).getHighlightGroup());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
}
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane();
@ -84,6 +96,20 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
});
}
private TemplateCellElement getEditingCellElement(CellSelection cs) {
final ElementCasePane ePane = ElementCasePaneDelegate.this;
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement);
}
if (tplEC != null) {
SheetUtils.calculateDefaultParent(tplEC);
}
return editCellElement;
}
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;

20
designer/src/com/fr/design/present/ConditionAttributesGroupPane.java

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.fr.base.FRContext;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.general.NameObject;
import com.fr.design.condition.HighLightConditionAttributesPane;
import com.fr.design.gui.controlpane.JListControlPane;
@ -15,13 +16,29 @@ import com.fr.report.cell.cellattr.highlight.Highlight;
import com.fr.report.cell.cellattr.highlight.HighlightGroup;
import com.fr.stable.Nameable;
public class ConditionAttributesGroupPane extends JListControlPane {
public class ConditionAttributesGroupPane extends UIListControlPane {
private static ConditionAttributesGroupPane singleton;
private ConditionAttributesGroupPane() {
super();
}
public static ConditionAttributesGroupPane getInstance() {
if (singleton == null) {
singleton = new ConditionAttributesGroupPane();
}
return singleton;
}
@Override
public NameableCreator[] createNameableCreators() {
return new NameableCreator[] { new NameObjectCreator(Inter.getLocText("Condition_Attributes"), DefaultHighlight.class, HighLightConditionAttributesPane.class) };
}
@Override
public void saveSettings() {
}
@Override
public String title4PopupWindow() {
return Inter.getLocText("Condition_Attributes");
@ -33,6 +50,7 @@ public class ConditionAttributesGroupPane extends JListControlPane {
public void populate(HighlightGroup highlightGroup) {
// marks这个必须放在前面,不论是否有高亮分组都可以操作
if (highlightGroup == null || highlightGroup.size() <= 0) {
this.populate(new NameObject[0]);
return;
}
List<NameObject> nameObjectList = new ArrayList<NameObject>();

8
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -268,6 +268,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
return propertyItemMap.get(KEY_WIDGET_SETTINGS).getContentPane();
}
public void replaceConditionAttrPane(JComponent pane) {
propertyItemMap.get(KEY_CONDITION_ATTR).replaceContentPane(pane);
}
public JComponent getConditionAttrPane() {
return propertyItemMap.get(KEY_CONDITION_ATTR).getContentPane();
}
public void replaceHyperlinkPane(JComponent pane) {
propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(pane);
}

Loading…
Cancel
Save