     # Append the element.
     @paletteWrapper.appendChild @paletteHeader
 
+    @setPalette @paletteGroups
+
+  Editor::setPalette = (paletteGroups) ->
+    @paletteHeader.innerHTML = ''
+    @paletteGroups = paletteGroups
+
+    @currentPaletteBlocks = []
+    @currentPaletteMetadata = []
+
     paletteHeaderRow = null
+
     for paletteGroup, i in @paletteGroups then do (paletteGroup, i) =>
       # Start a new row, if we're at that point
       # in our appending cycle

  #
  # This happens at population time.
  hook 'populate', 0, ->
    @currentPaletteBlocks = []
    @currentPaletteMetadata = []

    # Create the hierarchical menu element.
    @paletteHeader = document.createElement 'div'
    @paletteHeader.className = 'melt-palette-header'

      # If we are the first element, make us the selected palette group.
      if i is 0
        do updatePalette

    @resizePalette()

  # The next thing we need to do with the palette
  # is let people pick things up from it.
