<commit_before>"""
Activity partition property page.
"""
import gtk
from gaphor.core import _, inject, transactional
from gaphor.ui.interfaces import IPropertyPage
from gaphor.diagram import items
from zope import interface, component
from gaphor import UML
from gaphor.adapters.propertypages import NamedItemPropertyPage


class PartitionPropertyPage(NamedItemPropertyPage):
    """
    Partition property page.
    """
    interface.implements(IPropertyPage)
    component.adapts(items.PartitionItem)

    element_factory = inject('element_factory')

    def construct(self):
        item = self.context

        page = super(PartitionPropertyPage, self).construct()

        if item.subject:
            if not item._toplevel:
                hbox = gtk.HBox(spacing=12)
                button = gtk.CheckButton(_('External'))
                button.set_active(item.subject.isExternal)
                button.connect('toggled', self._on_external_change)
                hbox.pack_start(button)
                page.pack_start(hbox, expand=False)
            else:
                pass
                #hbox = gtk.HBox(spacing=12)
                #button = gtk.CheckButton(_('Dimension'))
                #button.set_active(item.subject.isDimension)
                #button.connect('toggled', self._on_dimension_change)

        return page

    @transactional
    def _on_external_change(self, button):
        item = self.context
        if item.subject:
            item.subject.isExternal = button.get_active()
        item.request_update()


component.provideAdapter(PartitionPropertyPage, name='Properties')


# vim:sw=4:et:ai
<commit_msg>Fixed type in partitioning property page.<commit_after>"""
Activity partition property page.
"""
import gtk
from gaphor.core import _, inject, transactional
from gaphor.ui.interfaces import IPropertyPage
from gaphor.diagram import items
from zope import interface, component
from gaphor import UML
from gaphor.adapters.propertypages import NamedItemPropertyPage


class PartitionPropertyPage(NamedItemPropertyPage):
    """
    Partition property page.
    """
    interface.implements(IPropertyPage)
    component.adapts(items.PartitionItem)

    element_factory = inject('element_factory')

    def construct(self):
        item = self.item

        page = super(PartitionPropertyPage, self).construct()

        if item.subject:
            if not item._toplevel:
                hbox = gtk.HBox(spacing=12)
                button = gtk.CheckButton(_('External'))
                button.set_active(item.subject.isExternal)
                button.connect('toggled', self._on_external_change)
                hbox.pack_start(button)
                page.pack_start(hbox, expand=False)
            else:
                pass
                #hbox = gtk.HBox(spacing=12)
                #button = gtk.CheckButton(_('Dimension'))
                #button.set_active(item.subject.isDimension)
                #button.connect('toggled', self._on_dimension_change)

        return page

    @transactional
    def _on_external_change(self, button):
        item = self.item
        if item.subject:
            item.subject.isExternal = button.get_active()
        item.request_update()


component.provideAdapter(PartitionPropertyPage, name='Properties')


# vim:sw=4:et:ai

{'fraction_non_alphanumeric': 0.09077201447527142, 'fraction_numerical': 0.0030156815440289505, 'mean_word_length': 2.6015200868621062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5437470', 'n_tokens_mistral': 939, 'n_tokens_neox': 879, 'n_words': 183}