Browse Source

bugfix:单元格元素插入内容,对话框取消之后回到原内容

master
vito 7 years ago
parent
commit
800fb273b1
  1. 4
      designer/src/com/fr/quickeditor/CellQuickEditor.java

4
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -51,6 +51,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
/*占位label*/ /*占位label*/
protected static UILabel emptyLabel = new UILabel(); protected static UILabel emptyLabel = new UILabel();
private int currentSelectedIndex;
static { static {
emptyLabel.setPreferredSize(new Dimension(60, 20)); emptyLabel.setPreferredSize(new Dimension(60, 20));
} }
@ -148,12 +150,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
} else { } else {
comboBox.setSelectedIndex(1); comboBox.setSelectedIndex(1);
} }
currentSelectedIndex = comboBox.getSelectedIndex();
comboBox.addActionListener(new ActionListener() { comboBox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc); cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc);
selectedIndex = comboBox.getSelectedIndex(); selectedIndex = comboBox.getSelectedIndex();
cellInsertActions[selectedIndex].actionPerformed(e); cellInsertActions[selectedIndex].actionPerformed(e);
comboBox.setSelectedIndex(currentSelectedIndex);
} }
}); });
return comboBox; return comboBox;

Loading…
Cancel
Save