use of com.revolsys.swing.table.record.editor.RecordTableCellEditor in project com.revolsys.open by revolsys.
the class LayerRecordForm method editingStopped.
@Override
public void editingStopped(final ChangeEvent e) {
final RecordTableCellEditor editor = (RecordTableCellEditor) e.getSource();
final String name = editor.getFieldName();
final Object value = editor.getCellEditorValue();
setFieldValue(name, value, true);
}
use of com.revolsys.swing.table.record.editor.RecordTableCellEditor in project com.revolsys.open by revolsys.
the class RecordLayerTable method copyFieldValue.
public void copyFieldValue() {
if (isEditingCurrentCell()) {
final RecordTableCellEditor tableCellEditor = getTableCellEditor();
final JComponent editorComponent = tableCellEditor.getEditorComponent();
SwingUtil.dndCopy(editorComponent);
} else {
final RecordRowTableModel model = getTableModel();
final int row = TablePanel.getEventRow();
final int column = TablePanel.getEventColumn();
final Object value = model.getValueAt(row, column);
if (value != null) {
final String copyValue;
if (value instanceof Geometry) {
final Geometry geometry = (Geometry) value;
copyValue = geometry.toEwkt();
} else {
copyValue = model.toDisplayValue(row, column, value);
}
final StringSelection transferable = new StringSelection(copyValue);
ClipboardUtil.setContents(transferable);
}
}
}
use of com.revolsys.swing.table.record.editor.RecordTableCellEditor in project com.revolsys.open by revolsys.
the class RecordLayerTablePanel method close.
@Override
public void close() {
final RecordLayerTable table = getTable();
if (table != null) {
final RecordTableCellEditor tableCellEditor = table.getTableCellEditor();
tableCellEditor.close();
table.dispose();
}
if (this.layer != null) {
MapPanel.getMapPanel(this.layer).removePropertyChangeListener("boundingBox", this.viewportListener);
Property.removeListener(this.layer, this);
this.layer.setPluginConfig(AbstractLayer.PLUGIN_TABLE_VIEW, toMap());
this.layer = null;
}
this.tableModel = null;
if (this.fieldFilterPanel != null) {
this.fieldFilterPanel.close();
this.fieldFilterPanel = null;
}
}
use of com.revolsys.swing.table.record.editor.RecordTableCellEditor in project com.revolsys.open by revolsys.
the class RecordLayerTable method cutFieldValue.
public void cutFieldValue() {
if (isEditingCurrentCell()) {
final RecordTableCellEditor tableCellEditor = getTableCellEditor();
final JComponent editorComponent = tableCellEditor.getEditorComponent();
SwingUtil.dndCut(editorComponent);
} else {
copyFieldValue();
final RecordRowTableModel model = getTableModel();
final int row = TablePanel.getEventRow();
final int column = TablePanel.getEventColumn();
model.setValueAt(null, row, column);
}
}
use of com.revolsys.swing.table.record.editor.RecordTableCellEditor in project com.revolsys.open by revolsys.
the class RecordLayerTable method pasteFieldValue.
public void pasteFieldValue() {
if (isEditingCurrentCell()) {
final RecordTableCellEditor tableCellEditor = getTableCellEditor();
final JComponent editorComponent = tableCellEditor.getEditorComponent();
SwingUtil.dndPaste(editorComponent);
} else {
try {
final Transferable clipboard = ClipboardUtil.getContents();
final Object value = clipboard.getTransferData(DataFlavor.stringFlavor);
final RecordRowTableModel model = getTableModel();
final int row = TablePanel.getEventRow();
final int column = TablePanel.getEventColumn();
model.setValueAt(value, row, column);
} catch (final Throwable e) {
}
}
}
Aggregations