Package com.alee.managers.popup

Examples of com.alee.managers.popup.WebPopup


    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        // Popup
        final WebPopup popup = new WebPopup ();
        popup.setMargin ( 20 );
        popup.add ( new WebImage ( loadIcon ( "move.png" ) ) );

        // Popup move mouse adapter
        ComponentMoveAdapter.install ( popup, popup );

        // Popup invoker button
        final WebButton showPopup = new WebButton ( "Show simple popup" );

        // Popup style chooser
        final WebComboBox popupStyle = new WebComboBox ( PopupStyle.values () );
        popupStyle.setSelectedItem ( PopupManager.getDefaultPopupStyle () );
        popupStyle.setRenderer ( new WebComboBoxCellRenderer ()
        {
            @Override
            public Component getListCellRendererComponent ( final JList list, final Object value, final int index, final boolean isSelected,
                                                            final boolean cellHasFocus )
            {
                return super.getListCellRendererComponent ( list, "Style: " + value, index, isSelected, cellHasFocus );
            }
        } );
        popupStyle.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                popup.setPopupStyle ( ( PopupStyle ) popupStyle.getSelectedItem () );
                popup.packPopup ();
            }
        } );

        // Popup show/hide action
        showPopup.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( popup.isShowing () )
                {
                    popup.hidePopup ();
                }
                else
                {
                    popup.showAsPopupMenu ( showPopup );
                }
            }
        } );

        return new GroupPanel ( 4, showPopup, popupStyle );
View Full Code Here


        final WebImage leadingComponent = new WebImage ( classSearchIcon );
        leadingComponent.setMargin ( 2 );
        classSearchField.setLeadingComponent ( leadingComponent );

        classSearchPopup = new WebPopup ();
        classSearchPopup.setCloseOnFocusLoss ( true );
        classSearchPopup.add ( classSearchField );
        classSearchPopup.setDefaultFocusComponent ( classSearchField );

        classSearchHintsPopup = new WebWindow ( classSearchPopup )
View Full Code Here

                        public void run ()
                        {
                            try
                            {
                                final String license = FileUtils.readToString ( structure.getEntryInputStream ( child ) );
                                final WebPopup licensePopup = new WebPopup ();
                                final WebTextArea textArea = new WebTextArea ( license );
                                textArea.setEditable ( false );
                                licensePopup.add ( new WebScrollPane ( textArea, false ) );
                                licensePopup.showPopupAsModal ( fileLink, true, true );
                                HotkeyManager.registerHotkey ( textArea, Hotkey.ESCAPE, new HotkeyRunnable ()
                                {
                                    @Override
                                    public void run ( final KeyEvent e )
                                    {
                                        licensePopup.hidePopup ();
                                    }
                                } );
                            }
                            catch ( final IOException e )
                            {
View Full Code Here

TOP

Related Classes of com.alee.managers.popup.WebPopup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.