コード例 #1
0
 def _buildLinkMenu(self, gravity):
     parentId = self.addMenu(_extstr(u"blogcontenteditorlinkmenumodel.Link"), gravity) #$NON-NLS-1$
     url = None
     linkMenuBuilder = ZLinkMenuModelBuilder()
     if self.zXHTMLEditControlLinkContext:
         url = linkMenuBuilder.getLinkLocation(self.zXHTMLEditControlLinkContext)            
     linkMenuBuilder.buildLinkMenu(self, parentId, url)
コード例 #2
0
 def buildCopyUrlLocationMenuItems(self, linkContext, imageContext, gravity, parentId, addSeparater):
     linkMenuBuilder = ZLinkMenuModelBuilder()
     imageMenuBuilder = ZImageMenuModelBuilder()
     linkLocation = linkMenuBuilder.getLinkLocation(linkContext)
     imageLocation = imageMenuBuilder.getImageLocation(imageContext)
     if not linkLocation and not imageLocation:
         return
     if addSeparater:
         self.addSeparator(gravity)
         gravity = gravity + 1
     if linkLocation:
         linkMenuBuilder.buildCopyLinkLocationMenuItem(self, gravity, parentId)
     if imageLocation:
         imageMenuBuilder.buildCopyImageLocationMenuItem(self, gravity, parentId)
コード例 #3
0
 def _buildRemoveElemMenuItem(self, gravity):  
     if self.zXHTMLEditControlLinkContext:      
         linkMenuBuilder = ZLinkMenuModelBuilder()
         linkLocation = linkMenuBuilder.getLinkLocation(self.zXHTMLEditControlLinkContext)
         if linkLocation:
             linkMenuBuilder.buildRemoveLinkMenuItem(self, gravity, None)
コード例 #4
0
    def _buildWysiwygEditorModel(self, resourceReg):
        # text ustification
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Align_Left"), 45, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_ALIGN_LEFT) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Align_Left")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_left.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_left_disabled.png")) #$NON-NLS-1$
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Center"), 50, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_ALIGN_CENTER) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Center")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_center.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_center_disabled.png")) #$NON-NLS-1$
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Align_Right"), 55, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_ALIGN_RIGHT) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Align_Right")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_right.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_right_disabled.png")) #$NON-NLS-1$ #$NON-NLS-1$
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Justify"), 60, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_JUSTIFY) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Justify")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_justify.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_align_justify_disabled.png")) #$NON-NLS-1$
        self.addSeparator(70)        
        
        # Indent
        toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.Indent"), 75, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_INDENT) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Indent")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_indent.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_indent_disabled.png")) #$NON-NLS-1$
        toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.De_Indent"), 80, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_OUTDENT) ) #$NON-NLS-1$
        self.setToolDescription(toolId,_extstr(u"blogeditortoolbarmodel.Remove_Indent")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_indent_remove.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_indent_remove_disabled.png")) #$NON-NLS-1$

        self.addSeparator(82)
        # Block quote
        toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.Blockquote"), 83, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_INDENT) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Blockquote")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_blockquote.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_blockquote_disabled.png")) #$NON-NLS-1$
        self.addSeparator(85)

        # Lists
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Bullet_List"), 90, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_UNORDERED_LIST) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Bulleted_List")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_list_bullets.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_list_bullets_disabled.png")) #$NON-NLS-1$
        toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Number_List"), 95, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_ORDERED_LIST) ) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Numbered_List")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_list_numbers.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_list_numbers_disabled.png")) #$NON-NLS-1$

        self.addSeparator(100)

        # Inserts (image, link, etc...)
        toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Insert_Image"), 105, ZBlogPostToolbarImagesAction( ZImageMenuModelBuilder().createImageMenuModel() )) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Insert_Image")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_image.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_image_disabled.png")) #$NON-NLS-1$\

        toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Insert_Link"), 110, ZBlogPostToolbarLinksAction( ZLinkMenuModelBuilder().createToolbarLinkMenuModel() )) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Insert_Link")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_link.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_link_disabled.png")) #$NON-NLS-1$

        toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Insert_Table"), 115, ZBlogPostInsertTableAction( ZTableModelBuilder().createToolbarTableMenuModel() )) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Insert_Table")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/table.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/table_disabled.png")) #$NON-NLS-1$

        toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.Extended_Entry"), 125, ZBlogPostInsertExtEntryMarkerContextMenuAction()) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Insert_Extended_Entry_marker")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_extentry.png")) #$NON-NLS-1$

        # Spell Check
        self.addSeparator(130)
        toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.Spell_Check"), 135, ZBlogPostSpellCheckAction()) #$NON-NLS-1$
        self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Check_Spelling")) #$NON-NLS-1$
        self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_spellcheck.png")) #$NON-NLS-1$
        self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_spellcheck_disabled.png")) #$NON-NLS-1$