abstract class Edit
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) UserOptions |
preferences |
| Constructor and Description |
|---|
Edit() |
| Modifier and Type | Method and Description |
|---|---|
(package private) abstract UserWorkSpace |
copy(UserWorkSpace uws)
Copy the currently selected text segment into the clipboard.
|
(package private) abstract UserWorkSpace |
cut(UserWorkSpace uws)
Move the currently selected text segment into the clipboard and remove
the segment from its context.
|
(package private) abstract UserWorkSpace |
delete(UserWorkSpace uws)
Remove the currently selected text from the context.
|
(package private) abstract UserWorkSpace |
paste(UserWorkSpace uws)
Paste the contents of the clipboard into the currently selected start
position, replacing any selected text from start to end position.
|
(package private) abstract UserWorkSpace |
undo(UserWorkSpace uws)
Undo the most recent scheduling operation.
|
UserOptions preferences
abstract UserWorkSpace undo(UserWorkSpace uws)
pre:
//
// The previous saved calendar state is not null.
//
(uws.previous_state != null);
post:
//
// The state of the current calendar is the previous state, and vice
// versa.
//
(return.previous_state = uws.calendars[1].items) &&
(uws.calendars[1].items = uws.previous_state);abstract UserWorkSpace cut(UserWorkSpace uws)
pre:
//
// The selection is not empty.
//
uws.selection != null;
post:
//
// The clipboard of the output workspace equals the selection. The
// selection context of the output workspace has the selection removed.
// The selection of the output workspace is null.
//
(return.clipboard = uws.context.substring(
uws.selection.startPosition, uws.selection.endPosition)
&&
(return.context.equals(
uws.context.substring(1,uws.selection.start_position-1) +
uws.context.substring(uws.selection.startPosition+1,
uws.context.size())))
&&
(return.selection == null);abstract UserWorkSpace copy(UserWorkSpace uws)
pre:
//
// The selection is not empty.
//
uws.selection != null;
post:
//
// The clipboard of the output workspace equals the selection. The
// context and selection of the output workspace are unchanged.
//
(return.context.equals(
uws.context.substring(1,uws.selection.start_position-1) +
uws.context.substring(uws.selection.startPosition+1,
uws.context.size())))
&&
(return.context.equals(uws.context))
&&
(return.selection.equals(uws.selection));abstract UserWorkSpace paste(UserWorkSpace uws)
pre:
//
// The clipboard is not empty.
//
uws.clipboard != null;
post:
//
// The context in the output workspace is the string consiting of
// everything up to the selection, followed by the clipboard, followed
// by everything after the selection. The selection of the output
// workspace is null and the clipboard is unchanged.
//
(return.context.equals(
uws.context.substring(1,uws.selection.start_position-1) +
uws.clipboard +
uws.context.substring(uws.selection.start_position+1,
uws.context.size)))
&&
(return.selection == null)
&&
(return.clipboard.equals(uws.clipboard));abstract UserWorkSpace delete(UserWorkSpace uws)
pre:
//
// The selection is not empty.
//
uws.selection != null;
postcondition:
//
// The selection context of the output workspace has the selection
// removed. The selection of the output workspace is null.
//
(return.context.equals(
uws.context.substring(1,uws.selection.start_position-1) +
uws.context.substring(uws.selection.start_position+1,
(uws.context.size()))))
&&
(return.selection == null);