@ -8,6 +8,7 @@
import java.awt.* ;
import java.awt.event.* ;
import java.util.List ;
import javax.swing.* ;
import javax.swing.text.* ;
@ -16,6 +17,7 @@
import net.java.sip.communicator.impl.gui.main.* ;
import net.java.sip.communicator.impl.gui.main.call.* ;
import net.java.sip.communicator.impl.gui.utils.* ;
import net.java.sip.communicator.service.protocol.* ;
import net.java.sip.communicator.util.skin.* ;
import net.java.sip.communicator.util.swing.* ;
import net.java.sip.communicator.util.swing.event.* ;
@ -66,10 +68,6 @@ public UnknownContactPanel(MainFrame window)
this . add ( mainPanel , BorderLayout . NORTH ) ;
initTextArea ( parentWindow . getCurrentSearchText ( ) ) ;
mainPanel . add ( textArea , BorderLayout . CENTER ) ;
TransparentPanel buttonPanel
= new TransparentPanel ( new GridLayout ( 0 , 1 ) ) ;
@ -96,31 +94,56 @@ public void actionPerformed(ActionEvent e)
} ) ;
}
callContact . setAlignmentX ( JButton . CENTER_ALIGNMENT ) ;
List < ProtocolProviderService > telephonyProviders
= CallManager . getTelephonyProviders ( ) ;
if ( telephonyProviders ! = null & & telephonyProviders . size ( ) > 0 )
{
callContact . setAlignmentX ( JButton . CENTER_ALIGNMENT ) ;
callContact . setMnemonic ( GuiActivator . getResources ( )
. getI18nMnemonic ( "service.gui.CALL_CONTACT" ) ) ;
callContact . setMnemonic ( GuiActivator . getResources ( )
. getI18nMnemonic ( "service.gui.CALL_CONTACT" ) ) ;
buttonPanel . add ( callContact ) ;
buttonPanel . add ( callContact ) ;
callContact . addActionListener ( new ActionListener ( )
{
public void actionPerformed ( ActionEvent e )
{
String searchText = parentWindow . getCurrentSearchText ( ) ;
TransparentPanel southPanel
= new TransparentPanel ( new FlowLayout ( FlowLayout . CENTER ) ) ;
southPanel . add ( buttonPanel ) ;
if ( searchText = = null )
return ;
mainPanel . add ( southPanel , BorderLayout . SOUTH ) ;
CallManager . createCall ( searchText , callContact ) ;
}
} ) ;
}
callContact . addActionListener ( new ActionListener ( )
initTextArea ( ) ;
mainPanel . add ( textArea , BorderLayout . CENTER ) ;
if ( callContact . getParent ( ) ! = null )
{
public void actionPerformed ( ActionEvent e )
{
String searchText = parentWindow . getCurrentSearchText ( ) ;
textArea . setText ( GuiActivator . getResources ( )
. getI18NString ( "service.gui.NO_CONTACTS_FOUND" ,
new String [ ] { '"'
+ parentWindow . getCurrentSearchText ( ) + '"' } ) ) ;
}
else
{
textArea . setText ( GuiActivator . getResources ( )
. getI18NString ( "service.gui.NO_CONTACTS_FOUND_SHORT" ) ) ;
}
if ( searchText = = null )
return ;
if ( buttonPanel . getComponentCount ( ) > 0 )
{
TransparentPanel southPanel
= new TransparentPanel ( new FlowLayout ( FlowLayout . CENTER ) ) ;
southPanel . add ( buttonPanel ) ;
CallManager . createCall ( searchText , callContact ) ;
}
} ) ;
mainPanel . add ( southPanel , BorderLayout . SOUTH ) ;
}
loadSkin ( ) ;
}
@ -160,13 +183,9 @@ public void textRemoved()
/ * *
* Creates the text area .
* @param searchText the searched text
* /
private void initTextArea ( String searchText )
private void initTextArea ( )
{
textArea . setText ( GuiActivator . getResources ( )
. getI18NString ( "service.gui.NO_CONTACTS_FOUND" ,
new String [ ] { '"' + searchText + '"' } ) ) ;
textArea . setOpaque ( false ) ;
textArea . setEditable ( false ) ;
StyledDocument doc = textArea . getStyledDocument ( ) ;
@ -186,11 +205,15 @@ private void initTextArea(String searchText)
* /
private void updateTextArea ( String searchText )
{
textArea . setText ( GuiActivator . getResources ( )
. getI18NString ( "service.gui.NO_CONTACTS_FOUND" ,
new String [ ] { '"' + searchText + '"' } ) ) ;
this . revalidate ( ) ;
this . repaint ( ) ;
if ( callContact . getParent ( ) ! = null )
{
textArea . setText ( GuiActivator . getResources ( )
. getI18NString ( "service.gui.NO_CONTACTS_FOUND" ,
new String [ ] { '"' + searchText + '"' } ) ) ;
this . revalidate ( ) ;
this . repaint ( ) ;
}
}
/ * *