Browse Source

加override

master
zack 9 years ago
parent
commit
b6433715ba
  1. 11
      designer_base/src/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 23
      designer_base/src/com/fr/design/gui/controlpane/JListControlPane.java

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

@ -75,6 +75,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
});
}
@Override
public void rename(String oldName, String newName) {
dsNameChangedMap.put(oldName, newName);
}
@ -84,6 +85,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
*
* @return /
*/
@Override
public boolean isNamePermitted() {
return isNamePermitted;
}
@ -92,6 +94,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/**
* 检查按钮可用状态 Check button enabled.
*/
@Override
public void checkButtonEnabled() {
super.checkButtonEnabled();
isNamePermitted = !isContainsRename();
@ -106,6 +109,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
*
* @return 数组
*/
@Override
public NameableCreator[] createNameableCreators() {
return TableDataCreatorProducer.getInstance().createServerTableDataCreator();
}
@ -166,6 +170,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/**
* Populate.
*/
@Override
public void populate(TableDataSource tds) {
List<NameObject> nameObjectList = new ArrayList<NameObject>();
@ -185,6 +190,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
/**
* Populate.
*/
@Override
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getTableDataNameIterator();
Iterator<String> procedurenameIt = datasourceManager.getProcedureNameIterator();
@ -201,6 +207,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
@Override
public void update(DatasourceManagerProvider datasourceManager) {
datasourceManager.clearAllTableData();
datasourceManager.clearAllProcedure();
@ -211,6 +218,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
}
@Override
public void update(TableDataSource tds) {
tds.clearAllTableData();
@ -256,10 +264,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
this.setSelectedName(name);
}
@Override
public Map<String, String> getDsNameChangedMap() {
return this.dsNameChangedMap;
}
@Override
public JPanel getPanel() {
return this;
}
@ -269,6 +279,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
*
* @param index 选中项的序列号
*/
@Override
public void setSelectedIndex(int index) {
nameableList.setSelectedIndex(index);
}

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

@ -51,6 +51,7 @@ public abstract class JListControlPane extends JControlPane {
this.initComponentPane();
}
@Override
protected JPanel createControlUpdatePane() {
return new JControlUpdatePane();
}
@ -60,6 +61,7 @@ public abstract class JListControlPane extends JControlPane {
*
* @return 按钮的NameableCreator
*/
@Override
public abstract NameableCreator[] createNameableCreators();
@ -107,6 +109,7 @@ public abstract class JListControlPane extends JControlPane {
}
@Override
protected ShortCut4JControlPane addItemShortCut() {
ShortCut addItemShortCut;
NameableCreator[] creators = creators();
@ -118,22 +121,27 @@ public abstract class JListControlPane extends JControlPane {
return new AbsoluteEnableShortCut(addItemShortCut);
}
@Override
protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction());
}
@Override
protected ShortCut4JControlPane copyItemShortCut() {
return new NormalEnableShortCut(new CopyItemAction());
}
@Override
protected ShortCut4JControlPane moveUpItemShortCut() {
return new NormalEnableShortCut(new MoveUpItemAction());
}
@Override
protected ShortCut4JControlPane moveDownItemShortCut() {
return new NormalEnableShortCut(new MoveDownItemAction());
}
@Override
protected ShortCut4JControlPane sortItemShortCut() {
return new NormalEnableShortCut(new SortItemAction());
}
@ -142,6 +150,7 @@ public abstract class JListControlPane extends JControlPane {
this.nameableList.setEditable(editable);
}
@Override
public Nameable[] update() {
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>();
((JControlUpdatePane) this.controlUpdatePane).update();
@ -309,6 +318,7 @@ public abstract class JListControlPane extends JControlPane {
* @param prefix 名字前缀
* @return 名字
*/
@Override
public String createUnrepeatedName(String prefix) {
DefaultListModel model = this.getModel();
Nameable[] all = new Nameable[model.getSize()];
@ -349,6 +359,7 @@ public abstract class JListControlPane extends JControlPane {
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
Nameable nameable = creator.createNameable(JListControlPane.this);
@ -386,6 +397,7 @@ public abstract class JListControlPane extends JControlPane {
}
}
@Override
public void actionPerformed(ActionEvent e) {
if (hasInvalid(true)) {
return;
@ -427,6 +439,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/base/images/cell/control/remove.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
try {
JListControlPane.this.nameableList.getCellEditor()
@ -454,6 +467,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/base/images/cell/control/copy.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
// p:选中的值.
ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue();
@ -488,6 +502,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/up.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
@ -520,6 +535,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/down.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
@ -550,6 +566,7 @@ public abstract class JListControlPane extends JControlPane {
.readIcon("/com/fr/design/images/control/sortAsc.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
// p:选中的值.
Object selectedValue = nameableList.getSelectedValue();
@ -568,6 +585,7 @@ public abstract class JListControlPane extends JControlPane {
// p:排序.
if (isAtoZ) {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return -ComparatorUtils.compare(o1.getName(), o2
.getName());
@ -577,6 +595,7 @@ public abstract class JListControlPane extends JControlPane {
Arrays.sort(nameableArray, nameableComparator);
} else {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o1.getName(), o2
.getName());
@ -634,6 +653,7 @@ public abstract class JListControlPane extends JControlPane {
evt.getY() - 1);
}
@Override
public void mouseMoved(MouseEvent e) {
}
@ -697,6 +717,7 @@ public abstract class JListControlPane extends JControlPane {
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(true);
}
@ -710,6 +731,7 @@ public abstract class JListControlPane extends JControlPane {
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(getModel()
.getSize() > 0
@ -918,6 +940,7 @@ public abstract class JListControlPane extends JControlPane {
return -1;
}
@Override
protected boolean hasInvalid(boolean isAdd) {
int idx = JListControlPane.this.getInValidIndex();
if (isAdd || nameableList.getSelectedIndex() != idx) {

Loading…
Cancel
Save