use of org.cytoscape.model.events.TableDeletedEvent in project cytoscape-impl by cytoscape.
the class CyTableManagerImpl method deleteTableInternal.
void deleteTableInternal(final long suid, boolean force) {
CyTable table;
synchronized (lock) {
table = tables.get(suid);
if (table == null) {
return;
}
}
final CyEventHelper eventHelper = serviceRegistrar.getService(CyEventHelper.class);
eventHelper.fireEvent(new TableAboutToBeDeletedEvent(this, table));
synchronized (lock) {
table = tables.get(suid);
if (table == null) {
return;
}
if (!force && (table.getMutability() != Mutability.MUTABLE)) {
throw new IllegalArgumentException("can't delete an immutable table.");
}
if (table instanceof CyTableImpl)
((CyTableImpl) table).removeAllVirtColumns();
tables.remove(suid);
}
eventHelper.fireEvent(new TableDeletedEvent(this));
logger.debug("CyTable removed: table ID = " + table.getSUID());
table = null;
}
Aggregations