示例#1
0
    def addBookmark(self, start, end=None, name=None, data=None):
        newBook = TextBookmark(start, end, name, data)

        for b in self._bookmarks:
            if b.start > start:
                self._bookmarks.insert(self._bookmarks.index(b), newBook)
                return newBook

        self._bookmarks.append(newBook)
        return newBook
示例#2
0
 def _cloneImpl(self, **kwargs):
     return TextBookmark._cloneImpl(self, blockDef=self._blockDef)
示例#3
0
 def __init__(self, blockDef, start, end =None, data =None, **kwargs):
     """Creates a new instance of TextBlock."""
     name = kwargs.get('name', blockDef.name)
     TextBookmark.__init__(self, start, end, name, data)
     self._blockDef = blockDef
示例#4
0
 def _cloneImpl(self, **kwargs):
     return TextBookmark._cloneImpl(self, blockDef=self._blockDef)
示例#5
0
 def __init__(self, blockDef, start, end=None, data=None, **kwargs):
     """Creates a new instance of TextBlock."""
     name = kwargs.get('name', blockDef.name)
     TextBookmark.__init__(self, start, end, name, data)
     self._blockDef = blockDef