Browse Source

REPORT-3163 合作开发9.0设计器=>条件属性=》实时保存,可撤销、重做

master
plough 7 years ago
parent
commit
1c5efe79e4
  1. 10
      designer/src/com/fr/design/present/ConditionAttributesGroupPane.java
  2. 39
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

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

@ -5,7 +5,9 @@ import java.util.List;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.design.condition.HighLightConditionAttributesPane; import com.fr.design.condition.HighLightConditionAttributesPane;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
@ -24,6 +26,7 @@ import com.fr.stable.Nameable;
public class ConditionAttributesGroupPane extends UIListControlPane { public class ConditionAttributesGroupPane extends UIListControlPane {
private static ConditionAttributesGroupPane singleton; private static ConditionAttributesGroupPane singleton;
private TemplateCellElement editCellElement; // 当前单元格对象
private ConditionAttributesGroupPane() { private ConditionAttributesGroupPane() {
super(); super();
@ -43,6 +46,11 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
@Override @Override
public void saveSettings() { public void saveSettings() {
if (isPopulating) {
return;
}
editCellElement.setHighlightGroup(updateHighlightGroup());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
} }
@Override @Override
@ -53,7 +61,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
public void populate(ElementCasePane ePane) { public void populate(ElementCasePane ePane) {
CellSelection cs = (CellSelection) ePane.getSelection(); CellSelection cs = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) { if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement); tplEC.addCellElement(editCellElement);

39
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -3,6 +3,7 @@ package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
@ -26,6 +27,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*; import javax.swing.*;
@ -436,6 +438,43 @@ public abstract class UIListControlPane extends UIControlPane {
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
} }
/**
* Gets component on toolbar.
*
* @return the created components on toolbar.
*/
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIButton.class.getName());
if (!(object instanceof AbstractButton)) {
// 直接使用默认UI
UIButton button = new UIButton();
// 添加一个名字作为自动化测试用
button.setName(getName());
//设置属性.
Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY);
if (mnemonicInteger != null) {
button.setMnemonic((char) mnemonicInteger.intValue());
}
button.setIcon((Icon) this.getValue(Action.SMALL_ICON));
button.addActionListener(this);
button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW);
this.putValue(UIButton.class.getName(), button);
button.setText(StringUtils.EMPTY);
button.setEnabled(this.isEnabled());
//peter:产生tooltip
button.setToolTipText(ActionFactory.createButtonToolTipText(this));
object = button;
}
return (JComponent) object;
}
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Nameable nameable = creator.createNameable(UIListControlPane.this); Nameable nameable = creator.createNameable(UIListControlPane.this);

Loading…
Cancel
Save