Methods Summary |
---|
public void | addCellEditorListener(javax.swing.event.CellEditorListener cellEditorListener)
listeners.addElement(cellEditorListener);
|
public void | cancelCellEditing()
fireEditingCanceled();
|
public void | createDialog()
JPanel pane = new JPanel();
principalsTable = new JTable();
JScrollPane sp = new JScrollPane(principalsTable);
d = new JDialog(this.frame, bundle.getString("PRIN_TITLE"), true); //NOI18N
d.setSize(500, 300);
d.getContentPane().setLayout(new BorderLayout());
pane.setLayout(new BorderLayout());
// d.getContentPane().add(sp, BorderLayout.CENTER);
pane.add(sp, BorderLayout.CENTER);
JButton okButton = new JButton(bundle.getString("OK_BUTTON_LABEL")); //NOI18N
JButton cancelButton = new JButton(bundle.getString("CANCEL_BUTTON_LABEL")); //NOI18N
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
stopCellEditing();
d.setVisible(false);
d.dispose();
}
});
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
cancelCellEditing();
d.setVisible(false);
d.dispose();
}
});
JPanel buttonsPane = new JPanel();
buttonsPane.add(okButton);
buttonsPane.add(cancelButton);
org.openide.util.HelpCtx.setHelpIDString(pane, helpBundle.getString("role_map_principal_editor")); //NOI18N
// d.getContentPane().add(buttonsPane, BorderLayout.SOUTH);
pane.add(buttonsPane, BorderLayout.SOUTH);
d.getContentPane().add(pane, BorderLayout.CENTER);
// d.setLocationRelativeTo(this.frame);
|
private void | fireEditingCanceled()
ChangeEvent ce = new ChangeEvent(this);
for (int i = listeners.size() - 1; i >= 0; i--) {
((CellEditorListener)listeners.elementAt(i)).editingCanceled(ce);
}
|
private void | fireEditingStopped()
ChangeEvent ce = new ChangeEvent(this);
for (int i = listeners.size() - 1; i >= 0; i--) {
((CellEditorListener)listeners.elementAt(i)).editingStopped(ce);
}
|
public java.lang.Object | getCellEditorValue()
return model;
|
public java.awt.Component | getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
if (value == null)
model = new Vector();
else if (value instanceof String && ((String)value).length() == 0)
model = new Vector();
else if (value instanceof Vector)
model = (Vector)value;
else
Reporter.error(value);
if (principalsTable == null)
createDialog();
principalsTable.setModel(new PrincipalTableModel(model));
originalValue = model;
table.setRowSelectionInterval(row, row);
table.setColumnSelectionInterval(column, column);
// return sp;
return button;
|
public boolean | isCellEditable(java.util.EventObject eventObject)
return true;
|
public void | removeCellEditorListener(javax.swing.event.CellEditorListener cellEditorListener)
listeners.removeElement(cellEditorListener);
|
public boolean | shouldSelectCell(java.util.EventObject eventObject)
return true;
|
public boolean | stopCellEditing()
if (principalsTable != null) {
TableCellEditor cell = principalsTable.getCellEditor();
if (cell != null)
cell.stopCellEditing();
}
model = ((PrincipalTableModel)principalsTable.getModel()).getPrincipals();
fireEditingStopped();
return true;
|