src/net/java/sip/communicator/impl/gui/main/call/PreCallDialog.java
/**
     * Creates this received call window.
     *
     * @param title the title of the created window
     * @param text the text to show
     * @param accounts the list of accounts to choose from
     * @return the created window
     */
Creates this received call window.
@param title the title of the created window
@param text the text to show
@param accounts the list of accounts to choose from
@return the created window
Creates this received call window . @param title the title of the created window @param text the text to show @param accounts the list of accounts to choose from @return the created window
private Window createPreCallWindow( String title,
                                        String text,
                                        Account[] accounts)
    {
        Window receivedCallWindow = null;
        if (OSUtils.IS_MAC)
        {
            HudWindow window = new HudWindow();
            window.hideCloseButton();
            JDialog dialog = window.getJDialog();
            dialog.setUndecorated(true);
            dialog.setTitle(title);
            receivedCallWindow = window.getJDialog();
            callLabelDisplayName = HudWidgetFactory.createHudLabel("");
            callLabelAddress = HudWidgetFactory.createHudLabel("");
            callLabelImage = HudWidgetFactory.createHudLabel("");
            if (accounts != null)
            {
                accountsCombo
                    = HudWidgetFactory.createHudComboBox(
                            new DefaultComboBoxModel(accounts));
            }
            else
                callLabelAccount = HudWidgetFactory.createHudLabel("");
        }
        else
        {
            SIPCommFrame frame = new SIPCommFrame(false);
            frame.setUndecorated(true);
            receivedCallWindow = frame;
            callLabelDisplayName = new JLabel();
            callLabelAddress = new JLabel();
            callLabelImage = new JLabel();
            if (accounts != null)
                accountsCombo = new JComboBox(accounts);
            else
                callLabelAccount = new JLabel();
        }
        if (text != null)
            callLabelDisplayName.setText(text);
        receivedCallWindow.setAlwaysOnTop(true);
        ComponentMover.registerComponent(receivedCallWindow);
        receivedCallWindow.setFocusableWindowState(false);
        return receivedCallWindow;
    }
private Window createPreCallWindow ( String title , String text , Account [ ] accounts ) { Window receivedCallWindow = null ; if ( OSUtils . IS_MAC ) { HudWindow window = new HudWindow ( ) ; window . hideCloseButton ( ) ; JDialog dialog = window . getJDialog ( ) ; dialog . setUndecorated ( true ) ; dialog . setTitle ( title ) ; receivedCallWindow = window . getJDialog ( ) ; callLabelDisplayName = HudWidgetFactory . createHudLabel ( "" ) ; callLabelAddress = HudWidgetFactory . createHudLabel ( "" ) ; callLabelImage = HudWidgetFactory . createHudLabel ( "" ) ; if ( accounts != null ) { accountsCombo = HudWidgetFactory . createHudComboBox ( new DefaultComboBoxModel ( accounts ) ) ; } else callLabelAccount = HudWidgetFactory . createHudLabel ( "" ) ; } else { SIPCommFrame frame = new SIPCommFrame ( false ) ; frame . setUndecorated ( true ) ; receivedCallWindow = frame ; callLabelDisplayName = new JLabel ( ) ; callLabelAddress = new JLabel ( ) ; callLabelImage = new JLabel ( ) ; if ( accounts != null ) accountsCombo = new JComboBox ( accounts ) ; else callLabelAccount = new JLabel ( ) ; } if ( text != null ) callLabelDisplayName . setText ( text ) ; receivedCallWindow . setAlwaysOnTop ( true ) ; ComponentMover . registerComponent ( receivedCallWindow ) ; receivedCallWindow . setFocusableWindowState ( false ) ; return receivedCallWindow ; }
Creates this received call window.
Creates this received call window .
// Register the JFrame so the dialog window is able to get dragged // across the screen // prevents dialog window to get unwanted key events and when going // on top on linux, it steals focus and if we are accidentally // writing something and pressing enter a call get answered