Modeler:15/DeleteFromRepository

From CaseTalk Wiki
Jump to: navigation, search

Delete from Repository is the one dialog behind every Delete command in the Modeler: the toolbar button and context menu of the Repository window, the context menu of the Fact Diagram, and Ctrl+Del in either. Whatever is selected, the same question is asked in the same way, and nothing is deleted until you have seen what goes with it.

Why

Deleting a type is rarely just that one type. Its expressions go, its roles leave the fact types they were part of, constraints on those roles are rewritten, and object types that only existed to serve it may be left without a use. The dialog runs the delete first, shows you the outcome, and only makes it permanent when you say so. Cancel leaves the model exactly as it was.

What to delete

The choices offered follow the selection. Only the meanings that apply are listed.

Choice Offered when What goes
Object/Fact Type name One or more types are selected — in the Repository window or in the diagram The type itself, all its expressions, its roles, its population, and every constraint that depended on them
Expression F1: ... only An expression is selected in the Repository window That one expression; the type stays, as do its other expressions
Tuple n of name only A single population row is selected under an expression That one row of the population

A role selected in the diagram stands for the fact type that owns it; the choice says so: Object/Fact Type 'X' (owner of the selected role 'r2').

Also remove object types this leaves without a use widens any of the first two choices to the object types that are no longer played anywhere once the delete has happened. It starts switched on when the project does not unify expressions and off when it does — the same default the Delete command always used, now visible. It does not apply to a tuple.

The preview

Two lists follow every change of choice:

  • Will be deleted — the expressions and tuples that disappear.
  • Will be changed or deleted — the object and fact types that are touched: some deleted outright, others left standing with a role, a constraint or a population changed.

The counts in the headings and the summary in the bottom bar make the size of a delete comparable at a glance: switch between only the expression and the whole type and watch the numbers move. Copy puts the whole preview on the clipboard, for a review or a ticket.

Delete makes it permanent; Cancel leaves the model untouched. Like every edit, a delete can be undone with Edit → Undo.

The short question

When the selection allows only one meaning and the preview shows nothing beyond the selected item itself — a label type that nothing else uses, say — the dialog is not shown. A plain Delete 'X'? question is enough, and answering Yes does the same thing.

When a delete is refused

The dialog states its reason rather than doing nothing: the model is read-only, another editor holds it, it reports errors that block editing, or it is in the middle of a GLR analysis. Finish or undo the analysis before deleting types.

Hide is not Delete

In the Fact Diagram the context menu shows Hide from Diagram (Del) directly above Delete (Ctrl+Del). Hiding takes the object off this diagram only; the model is not changed, and the type can be shown again. Delete is the command described on this page.