Store workspace contents in a method (as a String so the contents does not have to be valid code). Method updated whenever you "accept" the workspace contents. See the Workspaces class-side "documentation" category to get started.