Initialize the popup panel form for subscription
502805
function initPopupForm(){
  var popUpIsAlreadyVisible = $('#ep_email_form_popup').is(":visible");
  if(!popUpIsAlreadyVisible){ // if the popup isn't already visible
    var cookieVal = pad.getPadId() + "email";
    if(cookie.getPref(cookieVal) !== "true"){ // if this user hasn't already subscribed
      askClientToEnterEmail(); // ask the client to register TODO uncomment me for a pop up
    }
  }
}
387483
private void initContextMenauAndToolBar() {
        toolbar = new JToolBar();
        toolbar.add(new Button(saveAction));
        toolbar.add(new Button(printAction));
        toolbar.addSeparator();
        toolbar.add(new Button(zoomInAction));
        toolbar.add(new Button(zoomOutAction));
        toolbar.add(new Button(resetAction));
        toolbar.addSeparator();
        toolbar.add(new Button(enlargePlotAreaAction));
        toolbar.add(new Button(shrinkPlotAreaAction));
        toolbar.add(new Button(increaseHeightAction));
        toolbar.add(new Button(decreaseHeightAction));
        toolbar.add(new Button(increaseWidthAction));
        toolbar.add(new Button(decreaseWidthAction));
        toolbar.addSeparator();
        toolbar.add(new Button(propertyAction));
    
        decreaseHeightAction.setEnabled(false);
        decreaseWidthAction.setEnabled(false);
        
        //Initialize popup menu.
        popup = new JPopupMenu();        
        popup.add(new JMenuItem(saveAction));
        popup.add(new JMenuItem(printAction));
        popup.addSeparator();
        popup.add(new JMenuItem(zoomInAction));
        popup.add(new JMenuItem(zoomOutAction));
        popup.add(new JMenuItem(resetAction));
        popup.addSeparator();
        popup.add(new JMenuItem(enlargePlotAreaAction));
        popup.add(new JMenuItem(shrinkPlotAreaAction));
        popup.add(new JMenuItem(increaseHeightAction));
        popup.add(new JMenuItem(decreaseHeightAction));
        popup.add(new JMenuItem(increaseWidthAction));
        popup.add(new JMenuItem(decreaseWidthAction));
        popup.addSeparator();
        popup.add(new JMenuItem(propertyAction));
        
        AncestorListener ancestorListener = new AncestorListener() {

            @Override
            public void ancestorAdded(AncestorEvent ae) {
                boolean inScrollPane = false;
                Container parent = getParent();
                while (parent != null) {
                    if (parent instanceof JScrollPane) {
                        inScrollPane = true;
                        scrollPane = (JScrollPane) parent;
                        break;
                    }
                    
                    parent = parent.getParent();
                }
                
                increaseHeightAction.setEnabled(inScrollPane);
                increaseWidthAction.setEnabled(inScrollPane);
            }

            @Override
            public void ancestorRemoved(AncestorEvent ae) {
            }

            @Override
            public void ancestorMoved(AncestorEvent ae) {
            }
        };
        
        addAncestorListener(ancestorListener);
    }
865423
public function init()
    {
        $view = Yii::$app->getView();
        if ($this->popupMode) {
            AuthChoiceAsset::register($view);
            if (empty($this->clientOptions)) {
                $options = '';
            } else {
                $options = Json::htmlEncode($this->clientOptions);
            }
            $view->registerJs("jQuery('#" . $this->getId() . "').authchoice({$options});");
        } else {
            AuthChoiceStyleAsset::register($view);
        }
        $this->options['id'] = $this->getId();
        echo Html::beginTag('div', $this->options);
    }
1138437
@PostConstruct
    public void init() {
        root.getChildren().remove(dialog);

        centerButton.setOnAction(action -> {
            dialog.setTransitionType(DialogTransition.CENTER);
            dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));
        });

        topButton.setOnAction(action -> {
            dialog.setTransitionType(DialogTransition.TOP);
            dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));
        });

        rightButton.setOnAction(action -> {
            dialog.setTransitionType(DialogTransition.RIGHT);
            dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));
        });

        bottomButton.setOnAction(action -> {
            dialog.setTransitionType(DialogTransition.BOTTOM);
            dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));
        });

        leftButton.setOnAction(action -> {
            dialog.setTransitionType(DialogTransition.LEFT);
            dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE));
        });

        acceptButton.setOnAction(action -> dialog.close());

        alertButton.setOnAction(action -> {
            JFXAlert alert = new JFXAlert((Stage) alertButton.getScene().getWindow());
            alert.initModality(Modality.APPLICATION_MODAL);
            alert.setOverlayClose(false);
            JFXDialogLayout layout = new JFXDialogLayout();
            layout.setHeading(new Label("Modal Dialog using JFXAlert"));
            layout.setBody(new Label("Lorem ipsum dolor sit amet, consectetur adipiscing elit,"
                                     + " sed do eiusmod tempor incididunt ut labore et dolore magna"
                                     + " aliqua. Utenim ad minim veniam, quis nostrud exercitation"
                                     + " ullamco laboris nisi ut aliquip ex ea commodo consequat."));
            JFXButton closeButton = new JFXButton("ACCEPT");
            closeButton.getStyleClass().add("dialog-accept");
            closeButton.setOnAction(event -> alert.hideWithAnimation());
            layout.setActions(closeButton);
            alert.setContent(layout);
            alert.show();
        });
    }
164326
private void init(final Window window) {

        CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
        m_warningIcon.setContentMode(ContentMode.HTML);
        m_warningIcon.setValue(FontOpenCms.WARNING.getHtml());
        if (window != null) {
            m_cancel.addClickListener(e -> window.close());
        }
        m_table.setWidth("100%");
        m_table.setHeight("100%");

        List<CmsModuleRow> rows = new ArrayList<CmsModuleRow>();
        for (CmsModule module : OpenCms.getModuleManager().getAllInstalledModules()) {
            CmsModuleRow row = new CmsModuleRow(module);
            rows.add(row);
        }
        CmsBeanTableBuilder<CmsModuleRow> builder = CmsBeanTableBuilder.newInstance(CmsModuleRow.class);
        builder.buildTable(m_table, rows);
        m_table.setCellStyleGenerator(builder.getDefaultCellStyleGenerator());
        m_table.setItemIconPropertyId("icon");
        m_table.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        m_table.setSelectable(true);
        m_table.setVisibleColumns("name", "title");
        m_table.setSortContainerPropertyId("name");
        m_table.sort();

        m_filter.setIcon(FontOpenCms.FILTER);
        m_filter.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
        m_filter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
        m_filter.addTextChangeListener(new TextChangeListener() {

            public void textChange(TextChangeEvent event) {

                filterTable(event.getText());

            }
        });
    }
47293
private void initButtonPanel() {

        if ((m_buttonPanel == null) && m_isFrame) {
            m_buttonPanel = new FlowPanel();
            m_buttonPanel.addStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().popupButtonPanel());
            m_main.add(m_buttonPanel);
        }
    }
387000
function() {
          module.debug('Creating pop-up html');
          var
            html      = $module.data(metadata.html)      || settings.html,
            variation = $module.data(metadata.variation) || settings.variation,
            title     = $module.data(metadata.title)     || settings.title,
            content   = $module.data(metadata.content)   || $module.attr('title') || settings.content
          ;
          if(html || content || title) {
            if(!html) {
              html = settings.template({
                title   : title,
                content : content
              });
            }
            $popup = $('<div/>')
              .addClass(className.popup)
              .addClass(variation)
              .html(html)
            ;
            if(settings.inline) {
              module.verbose('Inserting popup element inline', $popup);
              $popup
                .insertAfter($module)
              ;
            }
            else {
              module.verbose('Appending popup element to body', $popup);
              $popup
                .appendTo( $context )
              ;
            }
            $.proxy(settings.onCreate, $popup)();
          }
          else {
            module.error(error.content);
          }
        }
1244960
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[grow]unrelated[]"));
        setContentPane(contentPane);

        // Combobox
        JComboBox comboBox = new JComboBox();
        contentPane.add(comboBox, "grow");
        comboBox.addItem("First");
        comboBox.addItem("Second");
        comboBox.addItem("Third");
        comboBox.addItemListener(this);

        // Panels
        cardContainer = new JPanel(new CardLayout());
        cardContainer.setBorder(new EmptyBorder(30, 30, 30, 30));
        cardContainer.add(new Card(), "First");
        cardContainer.add(new Card(), "Second");
        cardContainer.add(new Card(), "Third");
        contentPane.add(new JScrollPane(cardContainer));

        // Apply button
        contentPane.add(applyButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
//		size.width += 100;
//		setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
945972
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1"));
        setContentPane(contentPane);

        // Tabbed pane
        JTabbedPane tabbedPane = new JTabbedPane();
        contentPane.add(tabbedPane, "grow");

        // Create tabs
        tabbedPane.add("Constant info", createTabConstantInfo());
        tabbedPane.add("Disabled", createTabDisabled());
        tabbedPane.add("Single validation", createTabSingleCompWithValidation());
        tabbedPane.add("Split pane", createTabSplitPane());
        tabbedPane.add("Scroll pane", createTabScrollPane());
        tabbedPane.add("Small panels", createTabSmallPanels());

        // Set size
        Dimension size = new Dimension(640, 480);
        setSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
1164016
public void init() {

        try {
            List<CmsPropertyDefinition> properties = A_CmsUI.getCmsObject().readAllPropertyDefinitions();

            m_container = new IndexedContainer();
            for (TableColumn col : TableColumn.values()) {
                m_container.addContainerProperty(col, col.getType(), col.getDefaultValue());
            }
            setContainerDataSource(m_container);
            setItemIconPropertyId(TableColumn.Icon);
            setRowHeaderMode(RowHeaderMode.ICON_ONLY);

            setVisibleColumns(TableColumn.Name);

            for (CmsPropertyDefinition prop : properties) {
                Item item = m_container.addItem(prop);
                item.getItemProperty(TableColumn.Name).setValue(prop.getName());
            }
            addItemClickListener(new ItemClickListener() {

                private static final long serialVersionUID = 4807195510202231174L;

                public void itemClick(ItemClickEvent event) {

                    setValue(null);
                    select(event.getItemId());
                    if (event.getButton().equals(MouseButton.RIGHT) || (event.getPropertyId() == null)) {
                        m_menu.setEntries(
                            getMenuEntries(),
                            Collections.singleton(((CmsPropertyDefinition)getValue()).getName()));
                        m_menu.openForTable(event, event.getItemId(), event.getPropertyId(), CmsPropertyTable.this);
                    } else if (TableColumn.Name.equals(event.getPropertyId())) {
                        showResources(((CmsPropertyDefinition)getValue()).getName());
                    }

                }

            });

            setCellStyleGenerator(new CellStyleGenerator() {

                private static final long serialVersionUID = 1L;

                public String getStyle(Table source, Object itemId, Object propertyId) {

                    if (TableColumn.Name.equals(propertyId)) {
                        return " " + OpenCmsTheme.HOVER_COLUMN;
                    }
                    return null;
                }
            });

        } catch (CmsException e) {
            //
        }
    }
706747
public void openPopup() {
        // If the component is disabled, do nothing.
        if (!isEnabled()) {
            return;
        }
        // If the show popup menu button is not shown, do nothing.
        if (settings.getDisplayToggleTimeMenuButton() == false) {
            return;
        }
        // If this function was called programmatically, we may need to change the focus to this
        // popup.
        if (!timeTextField.hasFocus()) {
            timeTextField.requestFocusInWindow();
        }
        // Create a new time menu.
        timeMenuPanel = new TimeMenuPanel(this, settings);

        // Create a new custom popup.
        popup = new CustomPopup(timeMenuPanel, SwingUtilities.getWindowAncestor(this),
                this, settings.borderTimePopup);
        popup.setMinimumSize(new Dimension(
                this.getSize().width + 1, timeMenuPanel.getSize().height));
        // Calculate the default origin for the popup.
        int defaultX = timeTextField.getLocationOnScreen().x;
        int defaultY = timeTextField.getLocationOnScreen().y + timeTextField.getSize().height - 1;
        // Set the popup location. (Shared function.)
        DatePicker.zSetPopupLocation(popup, defaultX, defaultY, this, timeTextField, -1, 1);
        // Show the popup and request focus.
        popup.show();
        timeMenuPanel.requestListFocus();
    }
74233
protected function initForm()
    {
        $name = isset($this->options['name']) ? $this->options['name'] : '';
        if(empty($name)){
            $name = 'form_'.(count(self::$forms)+1);
        }
        unset($this->options['name']);

        $this->form = tao_helpers_form_FormFactory::getForm($name, $this->options);

        //add translate action in toolbar
        $actions = tao_helpers_form_FormFactory::getCommonActions();

        //add a hidden form element that states that it is an Instance Form.
        $instanceElt = tao_helpers_form_FormFactory::getElement('tao.forms.instance', 'Hidden');
        $instanceElt->setValue('1');
        $this->form->addElement($instanceElt, true);

        //add a token to protect against xsrf
        $tokenElt = tao_helpers_form_FormFactory::getElement('token', 'Token');
        $tokenElt->addValidator(new XsrfTokenValidator());
        $this->form->addElement($tokenElt, true);

        $this->form->setActions($actions, 'top');
        $this->form->setActions($actions, 'bottom');
    }
927090
private void initialize() {
		this.setLayout(new CardLayout());
		this.setName(getContextIndex() + ": " + PANEL_NAME);
		this.setLayout(new GridBagLayout());
		this.setBorder(new EmptyBorder(2, 2, 2, 2));

		this.add(new JLabel("<html><p>" + Constant.messages.getString("forceduser.panel.label.description")
				+ "</p></html>"), LayoutHelper.getGBC(0, 0, 1, 1.0D));

		// Forced User combo box
		this.add(getUsersComboBox(), LayoutHelper.getGBC(0, 2, 1, 1.0D, new Insets(5, 0, 0, 0)));

		// Padding
		this.add(new JLabel(), LayoutHelper.getGBC(0, 99, 1, 1.0D, 1.0D));
	}
514434
public void init() {
        OptionsParam options = Model.getSingleton().getOptionsParam();
        mainFrame = new MainFrame(options, getRequestPanel(), getResponsePanel());
        mainFrame.getWorkbench().addPanel(View.getSingleton().getSiteTreePanel(), WorkbenchPanel.PanelType.SELECT);

        // Install default editor and renderer for TextMessageLocationHighlight
        MessageLocationHighlightRenderersEditors.getInstance().addEditor(
                TextMessageLocationHighlight.class,
                new TextMessageLocationHighlightEditor());
        MessageLocationHighlightRenderersEditors.getInstance().addRenderer(
                TextMessageLocationHighlight.class,
                new TextMessageLocationHighlightRenderer());
        
        String statusString;
        for(Status status : AddOn.Status.values()) {     	
        	// Handle the case AddOn.Status gets out of sync with cfu.status i18n entries
        	String i18nKey = "cfu.status." + status.toString();
        	if (Constant.messages.containsKey(i18nKey)) {
        		statusString = Constant.messages.getString(i18nKey);
        	} else {
        		statusString = status.toString();
        	}
        	statusMap.put(status, new StatusUI(status, statusString));
        }
    }
1074553
private void initialize() {
        this.setTitle(Constant.messages.getString("siteselect.dialog.title"));
        this.setContentPane(getJPanel());
        this.addWindowListener(new java.awt.event.WindowAdapter() {   
        	@Override
        	public void windowOpened(java.awt.event.WindowEvent e) {    
        	} 

        	@Override
        	public void windowClosing(java.awt.event.WindowEvent e) {    
        	    cancelButton.doClick();
        	}
        });
		pack();
	}
677005
private void init() {
        setTitle("Validation Framework Test");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        // Create content pane
        JPanel contentPane = new JPanel(new MigLayout("fill, wrap 1", "[]", "[]related[]unrelated[]unrelated[]"));
        setContentPane(contentPane);

        // Checkbox to enable the tabbed pane
        JCheckBox tabbedPaneEnabledCheckBox = new JCheckBox("Enable tabbed pane");
        tabbedPaneEnabledCheckBox.setSelected(true);
        contentPane.add(tabbedPaneEnabledCheckBox);
        JCheckBox firstTabEnabledCheckBox = new JCheckBox("Enable first tab");
        firstTabEnabledCheckBox.setSelected(false);
        contentPane.add(firstTabEnabledCheckBox);

        // Tabbed pane
        final JTabbedPane tabbedPane = new JTabbedPane();
        contentPane.add(tabbedPane, "grow");

        // Create tabs
        CompositeReadableProperty<Boolean> tabbedPaneResultsProperty = new CompositeReadableProperty<Boolean>();
        for (int i = 0; i < 3; i++) {
            CompositeReadableProperty<Boolean> tabResultsProperty = new CompositeReadableProperty<Boolean>();
            tabbedPane.add("Tab " + i, createTabContent(tabResultsProperty));
            tabbedPaneResultsProperty.addProperty(installTabValidation(tabbedPane, i, tabResultsProperty));
            tabbedPane.setTitleAt(i, "Tab");
        }

        // Enable tabbed pane only if checkbox is selected
        read(new JToggleButtonSelectedProperty(tabbedPaneEnabledCheckBox)) //
                .write(new ComponentEnabledProperty(tabbedPane));

        // Enable first tab only if checkbox is selected
        read(new JToggleButtonSelectedProperty(firstTabEnabledCheckBox)) //
                .write(new WritableProperty<Boolean>() {
                    @Override
                    public void setValue(Boolean value) {
                        if (tabbedPane.getTabCount() > 0) {
                            tabbedPane.setEnabledAt(0, (value != null) && value);
                        }
                    }
                });

        // Install global validator
        installGlobalValidation(tabbedPaneResultsProperty, applyButton);

        // Apply button
        contentPane.add(applyButton, "align right");

        // Set size
        pack();
        Dimension size = getSize();
        size.width += 100;
        setMinimumSize(size);

        // Set location
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 3);
    }
600053
function initializeForm() {
    form = new Form( 'form.or:eq(0)', {
        modelStr: modelStr
    }, {
        arcGis: {
            basemaps: [ 'streets', 'topo', 'satellite', 'osm' ],
            webMapId: 'f2e9b762544945f390ca4ac3671cfa72',
            hasZ: true
        },
        'clearIrrelevantImmediately': true
    } );
    // for debugging
    window.form = form;
    //initialize form and check for load errors
    loadErrors = form.init();
    if ( loadErrors.length > 0 ) {
        window.alert( 'loadErrors: ' + loadErrors.join( ', ' ) );
    }
}