Container = {}

function Container:ShowText()
    EditorAPI.messageBox(self.range:extractText())
end

function Container:GetText()
    return self.range:extractText()
end

function Container:GetFragmentsWithText(target)
    EditorAPI.messageBox("GetFragmentsWithText")
end

function Container:GetFragmentsToShow()
    EditorAPI.messageBox("GetFragmentsToShow")
end

function Container:Create(context)
    local this = {}

    setmetatable( this, self )
    self.__index = self
    -- self.context = context
    -- self.range = document:getRange()
    
    --context.doWithSelection(
        --function(range)
    --        self.range = range
    --        EditorAPI.messageBox(self.range:extractText())
        --end
    --)
    
    context.doWithDocument(
        function(document)
            self.range = document:getRange()
        end
    )
    
    return this
end