Browse Source

REPORT-4267 单元格预定义控件不可用

master
yaoh.wu 7 years ago
parent
commit
033940a959
  1. 19
      designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  2. 27
      designer/src/com/fr/design/widget/WidgetPane.java

19
designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -2,18 +2,14 @@ package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
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.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.CellElement;
@ -34,7 +30,7 @@ public class CellWidgetPropertyPane extends BasicPane {
private WidgetPane cellEditorDefPane;
private ElementCasePane ePane;
public static CellWidgetPropertyPane getInstance(){
public static CellWidgetPropertyPane getInstance() {
if (singleton == null) {
singleton = new CellWidgetPropertyPane();
}
@ -43,11 +39,9 @@ public class CellWidgetPropertyPane extends BasicPane {
public CellWidgetPropertyPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
// this.addAttributeChangeListener(listener);
// cellEditorDefPane = new WidgetPane(elementCasePane);
}
public void clear (){
public void clear() {
singleton = null;
}
@ -86,7 +80,7 @@ public class CellWidgetPropertyPane extends BasicPane {
}
public void reInit(ElementCasePane ePane){
public void reInit(ElementCasePane ePane) {
this.ePane = ePane;
cellEditorDefPane = new WidgetPane(ePane);
this.removeAll();
@ -144,14 +138,15 @@ public class CellWidgetPropertyPane extends BasicPane {
return newWidget;
}
@Override
/**
*检测是否有效
* 检测是否有效
*
* @throws Exception e
*/
@Override
public void checkValid() throws Exception {
this.cellEditorDefPane.checkValid();
}
}

27
designer/src/com/fr/design/widget/WidgetPane.java

@ -65,7 +65,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
this.addAttributeChangeListener(listener);
}
public JPanel initNorthPane(){
public JPanel initNorthPane() {
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
@ -80,7 +80,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
return jPanel;
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {
return new CellWidgetCardPane(pane);
}
@ -129,30 +129,29 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
editorTypeComboBox.setSelectedIndex(-1);
return;
}
// 预定义组件
if (widget instanceof NameWidget) {
String name = ((NameWidget) widget).getName();
shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItem(new Item(name, name));
shouldFireSelectedEvent = true;
cellEditorCardPane.populate(widget);
return;
}
// 内置组件
else {
Class clazz = widget.getClass();
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) {
clazz = Button.class;
}
cellEditorCardPane.populate(widget);
Class clazz = widget.getClass();
if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) {
clazz = Button.class;
shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
shouldFireSelectedEvent = true;
}
cellEditorCardPane.populate(widget);
shouldFireSelectedEvent = false;
editorTypeComboBox.setSelectedItemByWidgetClass(clazz);
shouldFireSelectedEvent = true;
removeAttributeChangeListener();
initAllListeners();
this.addAttributeChangeListener(listener);
}
public Widget update() {

Loading…
Cancel
Save