Browse Source

加上override

master
zack 9 years ago
parent
commit
282b730267
  1. 10
      designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 24
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

10
designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -224,6 +224,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/** /**
* 判断数据集是否重名 * 判断数据集是否重名
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
List<String> exsitTableDataNameList = new ArrayList<String>(); List<String> exsitTableDataNameList = new ArrayList<String>();
// _denny: 判断是否有重复的数据集名 // _denny: 判断是否有重复的数据集名
@ -262,4 +263,13 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
public JPanel getPanel() { public JPanel getPanel() {
return this; return this;
} }
/**
* 设置选中项
*
* @param index 选中项的序列号
*/
public void setSelectedIndex(int index) {
nameableList.setSelectedIndex(index);
}
} }

24
designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

@ -63,6 +63,7 @@ public abstract class JListControlPane extends JControlPane {
public abstract NameableCreator[] createNameableCreators(); public abstract NameableCreator[] createNameableCreators();
@Override
protected void initLeftPane(JPanel leftPane) { protected void initLeftPane(JPanel leftPane) {
nameableList = createJNameList(); nameableList = createJNameList();
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
@ -89,6 +90,7 @@ public abstract class JListControlPane extends JControlPane {
public JNameEdList createJNameList() { public JNameEdList createJNameList() {
JNameEdList nameEdList = new JNameEdList(new DefaultListModel()) { JNameEdList nameEdList = new JNameEdList(new DefaultListModel()) {
@Override
protected void doAfterLostFocus() { protected void doAfterLostFocus() {
JListControlPane.this.updateControlUpdatePane(); JListControlPane.this.updateControlUpdatePane();
} }
@ -151,6 +153,7 @@ public abstract class JListControlPane extends JControlPane {
return res.toArray(new Nameable[res.size()]); return res.toArray(new Nameable[res.size()]);
} }
@Override
public void populate(Nameable[] nameableArray) { public void populate(Nameable[] nameableArray) {
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
listModel.removeAllElements(); listModel.removeAllElements();
@ -602,6 +605,7 @@ public abstract class JListControlPane extends JControlPane {
* JNameEdList的鼠标事件 * JNameEdList的鼠标事件
*/ */
private MouseListener listMouseListener = new MouseAdapter() { private MouseListener listMouseListener = new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent evt) { public void mouseReleased(MouseEvent evt) {
nameableList.stopEditing(); nameableList.stopEditing();
if (evt.getClickCount() >= 2 if (evt.getClickCount() >= 2
@ -638,6 +642,7 @@ public abstract class JListControlPane extends JControlPane {
/** /**
* 检查按钮可用状态 Check button enabled. * 检查按钮可用状态 Check button enabled.
*/ */
@Override
public void checkButtonEnabled() { public void checkButtonEnabled() {
int selectedIndex = nameableList.getSelectedIndex(); int selectedIndex = nameableList.getSelectedIndex();
@ -651,19 +656,12 @@ public abstract class JListControlPane extends JControlPane {
} }
} }
protected void doBeforeRemove() {
}
protected void doAfterRemove() {
}
/* /*
* Nameable的ListCellRenerer * Nameable的ListCellRenerer
*/ */
private class NameableListCellRenderer extends private class NameableListCellRenderer extends
DefaultListCellRenderer { DefaultListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, super.getListCellRendererComponent(list, value, index, isSelected,
@ -899,6 +897,7 @@ public abstract class JListControlPane extends JControlPane {
* *
* @throws Exception * @throws Exception
*/ */
@Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
((JControlUpdatePane) this.controlUpdatePane).checkValid(); ((JControlUpdatePane) this.controlUpdatePane).checkValid();
} }
@ -933,13 +932,4 @@ public abstract class JListControlPane extends JControlPane {
return false; return false;
} }
/**
* 设置选中项
*
* @param index 选中项的序列号
*/
public void setSelectedIndex(int index) {
nameableList.setSelectedIndex(index);
}
} }
Loading…
Cancel
Save