|
|
@ -31,37 +31,38 @@ public class UITableEditorPane<T> extends BasicPane { |
|
|
|
private String leftLabelName; |
|
|
|
private String leftLabelName; |
|
|
|
private JPanel buttonPane; |
|
|
|
private JPanel buttonPane; |
|
|
|
|
|
|
|
|
|
|
|
public UITableEditorPane(UITableModelAdapter<T> model) { |
|
|
|
public UITableEditorPane(UITableModelAdapter<T> model) { |
|
|
|
this.tableModel = model; |
|
|
|
this.tableModel = model; |
|
|
|
this.initComponent(model.createAction()); |
|
|
|
this.initComponent(model.createAction()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public UITableEditorPane(UITableModelAdapter<T> model, String s) { |
|
|
|
public UITableEditorPane(UITableModelAdapter<T> model, String s) { |
|
|
|
leftLabelName = s; |
|
|
|
leftLabelName = s; |
|
|
|
this.tableModel = model; |
|
|
|
this.tableModel = model; |
|
|
|
this.initComponent(model.createAction()); |
|
|
|
this.initComponent(model.createAction()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initComponent(UITableEditAction[] action) { |
|
|
|
private void initComponent(UITableEditAction[] action) { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
JPanel pane = new JPanel(new BorderLayout(4, 4)); |
|
|
|
JPanel pane = new JPanel(new BorderLayout(4, 4)); |
|
|
|
this.add(pane, BorderLayout.CENTER); |
|
|
|
this.add(pane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
UILabel l = new UILabel(leftLabelName); |
|
|
|
UILabel l = new UILabel(leftLabelName); |
|
|
|
editTable = tableModel.createTable(); |
|
|
|
editTable = tableModel.createTable(); |
|
|
|
|
|
|
|
editTable.getTableHeader().setBackground(UIConstants.DEFAULT_BG_RULER); |
|
|
|
UIScrollPane scrollPane = new UIScrollPane(editTable); |
|
|
|
|
|
|
|
scrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); |
|
|
|
UIScrollPane scrollPane = new UIScrollPane(editTable); |
|
|
|
pane.add(scrollPane, BorderLayout.CENTER); |
|
|
|
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); |
|
|
|
initbuttonPane(action); |
|
|
|
pane.add(scrollPane, BorderLayout.CENTER); |
|
|
|
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
initbuttonPane(action); |
|
|
|
controlPane.add(buttonPane, BorderLayout.EAST); |
|
|
|
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
controlPane.add(l, BorderLayout.WEST); |
|
|
|
controlPane.add(buttonPane, BorderLayout.EAST); |
|
|
|
pane.add(controlPane, BorderLayout.NORTH); |
|
|
|
controlPane.add(l, BorderLayout.WEST); |
|
|
|
|
|
|
|
pane.add(controlPane, BorderLayout.NORTH); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
public UITableModelAdapter<T> getTableModel() { |
|
|
|
|
|
|
|
|
|
|
|
public UITableModelAdapter<T> getTableModel(){ |
|
|
|
return tableModel; |
|
|
|
return tableModel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|