/** * Creates either Remove or Exclude action depending on property type */ protected RemoveAction createRemoveAction(MetaProperty metaProperty, Table table) { RemoveAction result; switch (metaProperty.getType()) { case COMPOSITION: result = new com.haulmont.cuba.gui.components.actions.RemoveAction(table); break; case ASSOCIATION: result = new com.haulmont.cuba.gui.components.actions.ExcludeAction(table); result.setShortcut(configuration.getConfig(ClientConfig.class).getTableRemoveShortcut()); break; default: throw new IllegalArgumentException("property must contain an entity"); } result.setAutocommit(false); return result; }