Browse Source

极速分层构建

master
juhaoyu 8 years ago
parent
commit
871c2313e8
  1. 7
      designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
  2. 3
      designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java

7
designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java

@ -86,7 +86,9 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
//先要停止编辑,然后再添加
fieldEditor.stopCellEditing();
layerIndexEditor.stopCellEditing();
LayerDependenceSettingPane.this.model.addDependence(); LayerDependenceSettingPane.this.model.addDependence();
} }
}); });
@ -102,6 +104,9 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
//获取视图索引,并根据视图索引获取model索引,删除model指定行 //获取视图索引,并根据视图索引获取model索引,删除model指定行
int selectedRow = dependenceTable.getSelectedRow(); int selectedRow = dependenceTable.getSelectedRow();
int selectedRowModelIndex = dependenceTable.convertRowIndexToModel(selectedRow); int selectedRowModelIndex = dependenceTable.convertRowIndexToModel(selectedRow);
//先要停止编辑,然后再删除
fieldEditor.stopCellEditing();
layerIndexEditor.stopCellEditing();
model.delDependence(selectedRowModelIndex); model.delDependence(selectedRowModelIndex);
} }
}); });

3
designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java

@ -7,6 +7,7 @@ import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
public class TreeModelWrapper implements Encoder, Decoder { public class TreeModelWrapper implements Encoder, Decoder {
@ -21,6 +22,8 @@ public class TreeModelWrapper implements Encoder, Decoder {
} else if (v instanceof TreeNodeWrapper) { } else if (v instanceof TreeNodeWrapper) {
TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs(); TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs();
return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""}); return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""});
} else if (v instanceof NameObject) {
return Inter.getLocText("FR-Designer_DataTable-Build");
} else { } else {
return Inter.getLocText("FR-Designer_Auto-Build"); return Inter.getLocText("FR-Designer_Auto-Build");
} }

Loading…
Cancel
Save