Creates a new popup with the specified style name and contents and shows it near the
specified target widget. Returns the newly created popup.
975749
public static PopupPanel newPopup (String styleName, Widget contents,
                                       Position pos, Widget target)
    {
        PopupPanel panel = newPopup(styleName, contents);
        show(panel, pos, target);
        return panel;
    }
423012
def create_ui(self):
        
        self.entry = gtk.Entry()
        self.widget.add(self.entry)
888659
function()
                {
                    var $toolbar = $('<div/>').addClass( 'wysiwyg-toolbar' ).addClass( toolbar_top ? 'wysiwyg-toolbar-top' : 'wysiwyg-toolbar-bottom' );
                    if( toolbar_focus )
                        $toolbar.hide().addClass( 'wysiwyg-toolbar-focus' );
                    // Add buttons to the toolbar
                    add_buttons_to_toolbar( $toolbar, false,
                        function() {
                            // Open a popup from the toolbar
                            var $popup = $(wysiwygeditor.openPopup());
                            // if wrong popup -> create a new one
                            if( $popup.hasClass('wysiwyg-popup') && $popup.hasClass('wysiwyg-popuphover') )
                                $popup = $(wysiwygeditor.closePopup().openPopup());
                            if( ! $popup.hasClass('wysiwyg-popup') )
                                // add classes + content
                                $popup.addClass( 'wysiwyg-popup' );
                            return $popup;
                        },
                        function( $popup, target, overwrite_offset ) {
                            // Popup position
                            var $button = $(target);
                            var popup_width = $popup.outerWidth();
                            // Point is the top/bottom-center of the button
                            var left = $button.offset().left - $container.offset().left + parseInt($button.width() / 2) - parseInt(popup_width / 2);
                            var top = $button.offset().top - $container.offset().top;
                            if( toolbar_top )
                                top += $button.outerHeight();
                            else
                                top -= $popup.outerHeight();
                            if( overwrite_offset )
                            {
                                left = overwrite_offset.left;
                                top = overwrite_offset.top;
                            }
                            popup_position( $popup, $container, left, top );
                        });
                    if( toolbar_top )
                        $container.prepend( $toolbar );
                    else
                        $container.append( $toolbar );
                }
864216
def create_widget(self):
        
        d = self.declaration
        self.widget = TabLayout(self.get_context(), None, d.style)
78868
def popup(self, title, callfn, initialdir=None):
        """"""
        super(DirectorySelection, self).popup(title, callfn, initialdir)
333818
def create_widget(self):
        
        d = self.declaration
        self.widget = DrawerLayout(self.get_context(),  None, d.style)
113185
function popupClick(e) {

    var editor = this,
        popup = e.data.popup,
        target = e.target;

    // Check for message and prompt popups
    if (popup === popups.msg || $(popup).hasClass(PROMPT_CLASS))
      return;

    // Get the button info
    var buttonDiv = $.data(popup, BUTTON),
        buttonName = $.data(buttonDiv, BUTTON_NAME),
        button = buttons[buttonName],
        command = button.command,
        value,
        useCSS = editor.options.useCSS;

    // Get the command value
    if (buttonName == "font")
      // Opera returns the fontfamily wrapped in quotes
      value = target.style.fontFamily.replace(/"/g, "");
    else if (buttonName == "size") {
      if (target.tagName == "DIV")
        target = target.children[0];
      value = target.innerHTML;
    }
    else if (buttonName == "style")
      value = "<" + target.tagName + ">";
    else if (buttonName == "color")
      value = hex(target.style.backgroundColor);
    else if (buttonName == "highlight") {
      value = hex(target.style.backgroundColor);
      if (ie) command = 'backcolor';
      else useCSS = true;
    }

    // Fire the popupClick event
    var data = {
      editor: editor,
      button: buttonDiv,
      buttonName: buttonName,
      popup: popup,
      popupName: button.popupName,
      command: command,
      value: value,
      useCSS: useCSS
    };

    if (button.popupClick && button.popupClick(e, data) === false)
      return;

    // Execute the command
    if (data.command && !execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))
      return false;

    // Hide the popup and focus the editor
    hidePopups();
    focus(editor);

  }
1567
public static HorizontalPanel newRow (String styleName, Widget... contents)
    {
        return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents);
    }
357008
function (target, x, y) {
                // check for template context
                var previousTarget;
                // look for the first template
                var body = Aria.$window.document.body;
                while (target && target != body && !target.__template) {
                    previousTarget = target;
                    target = target.parentNode;
                }
                // check for dom position

                if (target == body && previousTarget) {
                    // prevousTarget might be a popup
                    // first check whether the PopupManager is loaded:
                    if (aria.popups && aria.popups.PopupManager) {
                        // then look for the popup:
                        var popup = aria.popups.PopupManager.getPopupFromDom(previousTarget);
                        if (popup && popup.section && popup.section.tplCtxt) {
                            // a popup was found
                            this._notifyFound(popup.section.tplCtxt, x, y);
                        }
                    }
                } else if (target && target != body) {
                    this._notifyFound(contextManager.getFromDom(target.parentNode), x, y);
                }

            }
50334
def create_widget(self):
        
        d = self.declaration
        self.widget = EditText(self.get_context(), None,
                               d.style or "@attr/editTextStyle")
1117142
def create_widget(self):
        
        d = self.declaration
        self.widget = CoordinatorLayout(self.get_context(), None, d.style)
589356
function createElement() {

  let e = document.getElementById(config.name.div)
  if (e !== null) {
    document.body.removeChild(e);
  }

  let newElem = document.createElement('div');
  newElem.id = config.name.div;
  newElem.className = 'live2d-widget-container';
  newElem.style.setProperty('position', 'fixed');
  newElem.style.setProperty(config.display.position, config.display.hOffset + 'px');
  newElem.style.setProperty('bottom', config.display.vOffset + 'px');
  newElem.style.setProperty('width', config.display.width + 'px');
  newElem.style.setProperty('height', config.display.height + 'px');
  newElem.style.setProperty('z-index', 99999);
  newElem.style.setProperty('opacity', config.react.opacity);
  newElem.style.setProperty('pointer-events', 'none');
  document.body.appendChild(newElem);
  L2Dwidget.emit('create-container', newElem);

  if (config.dialog.enable)
    createDialogElement(newElem);

  let newCanvasElem = document.createElement('canvas');
  newCanvasElem.setAttribute('id', config.name.canvas);
  newCanvasElem.setAttribute('width', config.display.width * config.display.superSample);
  newCanvasElem.setAttribute('height', config.display.height * config.display.superSample);
  newCanvasElem.style.setProperty('position', 'absolute');
  newCanvasElem.style.setProperty('left', '0px');
  newCanvasElem.style.setProperty('top', '0px');
  newCanvasElem.style.setProperty('width', config.display.width + 'px');
  newCanvasElem.style.setProperty('height', config.display.height + 'px');
  if (config.dev.border) newCanvasElem.style.setProperty('border', 'dashed 1px #CCC');
  newElem.appendChild(newCanvasElem);

  currCanvas = document.getElementById(config.name.canvas);
  L2Dwidget.emit('create-canvas', newCanvasElem);

  initWebGL();

}
480628
function (templateCtxt, xpos, ypos) {

                // bridge is open -> inspector will handle this as well
                var bridge = aria.tools.ToolsBridge;
                if (bridge && bridge.isOpen) {
                    bridge.$raiseEvent({
                        name : "forwardEvent",
                        event : {
                            name : "ContextualTargetFound",
                            templateCtxt : templateCtxt
                        }
                    });
                }

                if (this._popup) {
                    return;
                }

                var popup = new ariaPopupsPopup();
                this._popup = popup;

                popup.$on({
                    "onAfterClose" : this._afterClose,
                    scope : this
                });

                // create a section on the founded template context
                var section = templateCtxt.createSection({
                    fn : function (out) {
                        var tplWidget = new ariaWidgetsTemplate({
                            defaultTemplate : this._appEnvCfg.template,
                            moduleCtrl : {
                                classpath : this._appEnvCfg.moduleCtrl,
                                initArgs : {
                                    templateCtxt : templateCtxt.$interface("aria.templates.ITemplateCtxt"),
                                    driver : this.$interface("aria.tools.contextual.IContextualMenu")
                                }
                            }
                        }, templateCtxt, "NOLINE");
                        out.registerBehavior(tplWidget);
                        tplWidget.writeMarkup(out);
                    },
                    scope : this
                });

                popup.open({
                    section : section,
                    absolutePosition : {
                        top : ypos,
                        left : xpos
                    },
                    modal : true,
                    maskCssClass : "xDialogMask" /* uses the css class from the AriaSkin */,
                    preferredPositions : [{
                                reference : "bottom left",
                                popup : "top left"
                            }, {
                                reference : "bottom left",
                                popup : "top right"
                            }],
                    offset : {
                        top : 0,
                        left : 0
                    },
                    closeOnMouseClick : true,
                    closeOnMouseScroll : true
                });

                this.targetTemplateCtxt = templateCtxt;

            }
330784
public static PushButton newImageButton (String style, ClickHandler onClick)
    {
        PushButton button = new PushButton();
        maybeAddClickHandler(button, onClick);
        return setStyleNames(button, style, "actionLabel");
    }
406134
function() {

            // creating template
            // <div class="gina-popins">
            //     <div class="gina-popins-overlay gina-popin-is-active"></div>
            // </div>
            var $container = document.createElement('div');
            $container.id = instance.id;
            $container.setAttribute('id', instance.id);
            $container.setAttribute('class', 'gina-popins');

            var $overlay = document.createElement('div');
            $overlay.setAttribute('id', 'gina-popins-overlay');
            $overlay.setAttribute('class', 'gina-popins-overlay');


            $container.appendChild( $overlay );

            // adding to DOM
            document.body.appendChild($container);

            instance.target     = $container;
            instance.on         = on;

            gina.popinContainer  = instance.id;
            gina.hasPopinHandler = true;
        }
682400
public void show (Popups.Position pos, Widget target)
    {
        Popups.show(this, pos, target);
    }
1029378
function createPopup(popupName, options, popupTypeClass, popupContent, popupHover) {

    // Check if popup already exists
    if (popups[popupName])
      return popups[popupName];

    // Create the popup
    var $popup = $(DIV_TAG)
      .hide()
      .addClass(POPUP_CLASS)
      .appendTo("body");

    // Add the content

    // Custom popup
    if (popupContent)
      $popup.html(popupContent);

    // Color
    else if (popupName == "color") {
      var colors = options.colors.split(" ");
      if (colors.length < 10)
        $popup.width("auto");
      $.each(colors, function(idx, color) {
        $(DIV_TAG).appendTo($popup)
          .css(BACKGROUND_COLOR, "#" + color);
      });
      popupTypeClass = COLOR_CLASS;
    }

    // Font
    else if (popupName == "font")
      $.each(options.fonts.split(","), function(idx, font) {
        $(DIV_TAG).appendTo($popup)
          .css("fontFamily", font)
          .html(font);
      });

    // Size
    else if (popupName == "size")
      $.each(options.sizes.split(","), function(idx, size) {
        $(DIV_TAG).appendTo($popup)
          .html("<font size=" + size + ">" + size + "</font>");
      });

    // Style
    else if (popupName == "style")
      $.each(options.styles, function(idx, style) {
        $(DIV_TAG).appendTo($popup)
          .html(style[1] + style[0] + style[1].replace("<", "</"));
      });

    // URL
    else if (popupName == "url") {
      $popup.html('Enter URL:<br><input type=text value="http://" size=35><br><input type=button value="Submit">');
      popupTypeClass = PROMPT_CLASS;
    }

    // Paste as Text
    else if (popupName == "pastetext") {
      $popup.html('Paste your content here and click submit.<br /><textarea cols=40 rows=3></textarea><br /><input type=button value=Submit>');
      popupTypeClass = PROMPT_CLASS;
    }

    // Add the popup type class name
    if (!popupTypeClass && !popupContent)
      popupTypeClass = LIST_CLASS;
    $popup.addClass(popupTypeClass);

    // Add the unselectable attribute to all items
    if (ie) {
      $popup.attr(UNSELECTABLE, "on")
        .find("div,font,p,h1,h2,h3,h4,h5,h6")
        .attr(UNSELECTABLE, "on");
    }

    // Add the hover effect to all items
    if ($popup.hasClass(LIST_CLASS) || popupHover === true)
      $popup.children().hover(hoverEnter, hoverLeave);

    // Add the popup to the array and return it
    popups[popupName] = $popup[0];
    return $popup[0];

  }