forked from External/mage
admin tools improves (#5388):
* added game ids and created time to tables list; * added popup hints support to tables list; * fixed wrong sorting and columns resizing in tables list; * refactored some modules to share table related code between client and admin console;
This commit is contained in:
parent
50c75f05bd
commit
fef37cdc73
14 changed files with 170 additions and 84 deletions
|
|
@ -5,6 +5,8 @@ import org.apache.log4j.Logger;
|
|||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* GUI related
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class TablesUtil {
|
||||
|
|
@ -42,22 +44,4 @@ public class TablesUtil {
|
|||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
public static int getSelectedModelRow(JTable table) {
|
||||
return getModelRowFromView(table, table.getSelectedRow());
|
||||
}
|
||||
|
||||
public static int getModelRowFromView(JTable table, int viewRow) {
|
||||
if (viewRow != -1 && viewRow < table.getModel().getRowCount()) {
|
||||
return table.convertRowIndexToModel(viewRow);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int getViewRowFromModel(JTable table, int modelRow) {
|
||||
if (modelRow != -1 && modelRow < table.getModel().getRowCount()) {
|
||||
return table.convertRowIndexToView(modelRow);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue