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