def __init__(self):
        super(PopupViewClosingExample, self).__init__()

        self.setSpacing(True)

        # Create the content for the popup
        content = Label('This popup will close as soon as you move the '
                'mouse cursor outside of the popup area.')
        # The PopupView popup will be as large as needed by the content
        content.setWidth('300px')
        # Construct the PopupView with simple HTML text representing the
        # minimized view
        popup = PopupView('Default popup', content)
        popup.setHideOnMouseOut(True)
        popup.addListener(self, IPopupVisibilityListener)
        self.addComponent(popup)

        content = Label('This popup will only close if you click '
                'the mouse outside the popup area.')
        # The PopupView popup will be as large as needed by the content
        content.setWidth('300px')
        popup = PopupView('Popup that won\'t auto-close', content)
        popup.setHideOnMouseOut(False)
        popup.addListener(self, IPopupVisibilityListener)
        self.addComponent(popup)
    def __init__(self):
        super(PopupViewContentsExample, self).__init__()

        self.setSpacing(True)

        # ------
        # Static content for the minimized view
        # ------

        # Create the content for the popup
        content = Label('This is a simple Label component inside the popup. '
                        'You can place any Muntjac components here.')

        # The PopupView popup will be as large as needed by the content
        content.setWidth('300px')

        # Construct the PopupView with simple HTML text representing the
        # minimized view
        popup = PopupView('Static HTML content', content)
        self.addComponent(popup)

        # ------
        # Dynamic content for the minimized view
        # ------

        # In this sample we update the minimized view value with the content of
        # the TextField inside the popup.
        popup = PopupView(PopupTextField())
        popup.setDescription('Click to edit')
        popup.setHideOnMouseOut(False)
        self.addComponent(popup)
    def createSearch(self):
        self._search = ComboBox()
        self._search.setWidth('160px')
        self._search.setNewItemsAllowed(False)
        self._search.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS)
        self._search.setNullSelectionAllowed(True)
        self._search.setImmediate(True)
        self._search.setInputPrompt('Search samples...')
        self._search.setContainerDataSource(self._app._allFeatures)

        for idd in self._app._allFeatures.getItemIds():
            if isinstance(idd, FeatureSet):
                pass  # FIXME: 'SamplerApplication' has no attribute 'getResourceAsStream'


#                self._search.setItemIcon(idd,
#                        ClassResource('folder.gif', self._app))

        self._search.addListener(SearchListener(self),
                                 prop.IValueChangeListener)

        # TODO add icons for section/sample
        # PopupView pv = new PopupView("", search) { public void
        # changeVariables(Object source, Map variables) {
        # super.changeVariables(source, variables); if (isPopupVisible()) {
        # search.focus(); } } };

        pv = PopupView('<span></span>', self._search)

        pv.addListener(PopupListener(self), IPopupVisibilityListener)
        pv.setStyleName('quickjump')
        pv.setDescription('Quick jump')

        return pv
    def createSearch(self):
        self._search = ComboBox()
        self._search.setWidth('160px')
        self._search.setNewItemsAllowed(False)
        self._search.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS)
        self._search.setNullSelectionAllowed(True)
        self._search.setImmediate(True)
        self._search.setInputPrompt('Search samples...')
        self._search.setContainerDataSource( self._app._allFeatures )

        for idd in self._app._allFeatures.getItemIds():
            if isinstance(idd, FeatureSet):
                pass  # FIXME: 'SamplerApplication' has no attribute 'getResourceAsStream'
#                self._search.setItemIcon(idd,
#                        ClassResource('folder.gif', self._app))

        self._search.addListener(SearchListener(self),
                prop.IValueChangeListener)

        # TODO add icons for section/sample
        # PopupView pv = new PopupView("", search) { public void
        # changeVariables(Object source, Map variables) {
        # super.changeVariables(source, variables); if (isPopupVisible()) {
        # search.focus(); } } };

        pv = PopupView('<span></span>', self._search)

        pv.addListener(PopupListener(self),
                IPopupVisibilityListener)
        pv.setStyleName('quickjump')
        pv.setDescription('Quick jump')

        return pv
    def __init__(self):
        super(PopupViewContentsExample, self).__init__()

        self.setSpacing(True)

        # ------
        # Static content for the minimized view
        # ------

        # Create the content for the popup
        content = Label('This is a simple Label component inside the popup. '
                'You can place any Muntjac components here.')

        # The PopupView popup will be as large as needed by the content
        content.setWidth('300px')

        # Construct the PopupView with simple HTML text representing the
        # minimized view
        popup = PopupView('Static HTML content', content)
        self.addComponent(popup)

        # ------
        # Dynamic content for the minimized view
        # ------

        # In this sample we update the minimized view value with the content of
        # the TextField inside the popup.
        popup = PopupView( PopupTextField() )
        popup.setDescription('Click to edit')
        popup.setHideOnMouseOut(False)
        self.addComponent(popup)