[sip-comm-dev] The way to add a button on the Chat Window


#1

Hello everybody,

I'm working on the spellcheck plugin and I'm trying to
add the spellcheck button on the chat window.
I don't understand why I have an error on Eclipse when
I write :

public SpellCheckToolbarButton()
    {
      EditTextToolBar spellcheckToolBar = new
EditTextToolBar;
      
         final SIPCommButton spellcheckButton= new
SIPCommButton(ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON),

ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON));
      
      spellcheckToolBar.add(spellcheckButton);
      
        spellcheckButton.addActionListener(this);
  
    }

It tells me that "EditTextToolBar cannot be resolved"
... :frowning:

Maybe I'm in the wrong way ...
Any suggestions ?

Toni

···

___________________________________________________________________________
D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions !
Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses
http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi Toni,

actually you're not supposed to create an instance of the EditTextToolBar and to add directly something to it. Instead you should use the UIService "addComponent" method. Have a look at the ExamplePluginActivator class and the following tutorial: http://www.sip-communicator.org/index.php/Documentation/UIService2 . The container you need to indicate is UIService.CONTAINER_CHAT_TOOL_BAR.

You should not use the ImageLoader either. You could have a look at other plugins to see how they access their pictures.

I really advise you to read the tutorial, it's not so big and the things will become clear after that.

Good luck!
Yana

Kaizersoze10 wrote:

···

Hello everybody,

I'm working on the spellcheck plugin and I'm trying to
add the spellcheck button on the chat window.
I don't understand why I have an error on Eclipse when
I write :

public SpellCheckToolbarButton() {
      EditTextToolBar spellcheckToolBar = new
EditTextToolBar;
      
         final SIPCommButton spellcheckButton= new
SIPCommButton(ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON),

ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON));
      
      spellcheckToolBar.add(spellcheckButton);
      
        spellcheckButton.addActionListener(this);
  
    }

It tells me that "EditTextToolBar cannot be resolved"
... :frowning:

Maybe I'm in the wrong way ... Any suggestions ?

Toni

      ___________________________________________________________________________ D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions ! Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hello Toni,

I guess the error you are getting comes from the fact that you have no parentheses after the instantiation.

However, you are not supposed to instantiate the EditTextToolBar. You should rather use the UIService.CONTAINER_CHAT_TOOL_BAR string container id with one of the UIService.addComponent() methods.

Hope this helps
Emil

Kaizersoze10 wrote:

···

Hello everybody,

I'm working on the spellcheck plugin and I'm trying to
add the spellcheck button on the chat window.
I don't understand why I have an error on Eclipse when
I write :

public SpellCheckToolbarButton() {
      EditTextToolBar spellcheckToolBar = new
EditTextToolBar;
      
         final SIPCommButton spellcheckButton= new
SIPCommButton(ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON),

ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON));
      
      spellcheckToolBar.add(spellcheckButton);
      
        spellcheckButton.addActionListener(this);
  
    }

It tells me that "EditTextToolBar cannot be resolved"
... :frowning:

Maybe I'm in the wrong way ... Any suggestions ?

Toni

      ___________________________________________________________________________ D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions ! Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi again Toni,

I've just made it possible to add plugin components (like the spellcheck button you'd like to add) in the chat main toolbar. I thought it was already possible, but I was wrong. So please use the last version from cvs in order to test your code.

Yana

Yana Stamcheva wrote:

···

Hi Toni,

actually you're not supposed to create an instance of the EditTextToolBar and to add directly something to it. Instead you should use the UIService "addComponent" method. Have a look at the ExamplePluginActivator class and the following tutorial: http://www.sip-communicator.org/index.php/Documentation/UIService2 . The container you need to indicate is UIService.CONTAINER_CHAT_TOOL_BAR.

You should not use the ImageLoader either. You could have a look at other plugins to see how they access their pictures.

I really advise you to read the tutorial, it's not so big and the things will become clear after that.

Good luck!
Yana

Kaizersoze10 wrote:

Hello everybody,

I'm working on the spellcheck plugin and I'm trying to
add the spellcheck button on the chat window.
I don't understand why I have an error on Eclipse when
I write :

public SpellCheckToolbarButton() {
        EditTextToolBar spellcheckToolBar = new
EditTextToolBar;
                  final SIPCommButton spellcheckButton= new
SIPCommButton(ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON),

               ImageLoader.getImage(ImageLoader.SPELLCHECK_ICON));
               spellcheckToolBar.add(spellcheckButton);
               spellcheckButton.addActionListener(this); }

It tells me that "EditTextToolBar cannot be resolved"
... :frowning:

Maybe I'm in the wrong way ... Any suggestions ?

Toni

      ___________________________________________________________________________ D�couvrez une nouvelle fa�on d'obtenir des r�ponses � toutes vos questions ! Profitez des connaissances, des opinions et des exp�riences des internautes sur Yahoo! Questions/R�ponses http://fr.answers.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net