[sip-comm-dev] Using UIService


#1

Hi,

Is it possible to call UI's MainFrame.getMultiUserChatManager() from within
a protocol provider?

I am trying to update the UI when a user calls /join #chatroom as a command
in IRC.

Such a case doesn't exist in IrcStack.sendCommand()
adding one
        else if(command.startsWith("/join"))
        {
            OperationSetMultiUserChat opMultiChat =
(OperationSetMultiUserChat)
                    parentProvider.getOperationSet(
                    OperationSetMultiUserChat.class);

            ChatRoom newChatRoom = opMultiChat.createChatRoom(
                    command.substring(6), null);

            UIServiceImpl serviceImpl =
(UIServiceImpl)IrcActivator.bundleContext.
                    getServiceReference(UIService.class.getName());

            serviceImpl.getMainFrame().getMultiUserChatManager().
                    joinChatRoom(newChatRoom);
        }

The above is not working as net.java.sip.communicator.impl.gui cannot be
included in IRC mainifest file.

···

-
Shobhit Jindal


#2

Hey Jindal,

Shobhit Jindal написа:

Hi,

Is it possible to call UI's MainFrame.getMultiUserChatManager() from
within a protocol provider?

You could do it with some tweaking but you shouldn't. It's supposed to
go the other way. If you feel something is missing in the UI, then
that's where you should be adding it.

Hope this helps!

Cheers
Emil

···

I am trying to update the UI when a user calls /join #chatroom as a
command in IRC.

Such a case doesn't exist in IrcStack.sendCommand()
adding one
        else if(command.startsWith("/join"))
        {
            OperationSetMultiUserChat opMultiChat =
(OperationSetMultiUserChat)
                    parentProvider.getOperationSet(
                    OperationSetMultiUserChat.class);
           
            ChatRoom newChatRoom = opMultiChat.createChatRoom(
                    command.substring(6), null);
           
            UIServiceImpl serviceImpl =
(UIServiceImpl)IrcActivator.bundleContext.
                    getServiceReference(UIService.class.getName());
           
            serviceImpl.getMainFrame().getMultiUserChatManager().
                    joinChatRoom(newChatRoom);
        }

The above is not working as net.java.sip.communicator.impl.gui cannot be
included in IRC mainifest file.

-
Shobhit Jindal

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


#3

Hi Shobhit,

actually this is already implemented (in the sendCommand method in the IrcStack it enters in the final "else").

I have just tried to join a room by typing /join #chatroom in an opened irc channel or the server channel and I've successfully joined the room (also a new tab appeared in the gui with all room members in the right).

So, if you're experiences problems in doing this, this should be a bug somewhere.

Cheers,
Yana

Shobhit Jindal wrote:

···

Hi,

Is it possible to call UI's MainFrame.getMultiUserChatManager() from within
a protocol provider?

I am trying to update the UI when a user calls /join #chatroom as a command
in IRC.

Such a case doesn't exist in IrcStack.sendCommand()
adding one
        else if(command.startsWith("/join"))
        {
            OperationSetMultiUserChat opMultiChat =
(OperationSetMultiUserChat)
                    parentProvider.getOperationSet(
                    OperationSetMultiUserChat.class);

            ChatRoom newChatRoom = opMultiChat.createChatRoom(
                    command.substring(6), null);

            UIServiceImpl serviceImpl =
(UIServiceImpl)IrcActivator.bundleContext.
                    getServiceReference(UIService.class.getName());

            serviceImpl.getMainFrame().getMultiUserChatManager().
                    joinChatRoom(newChatRoom);
        }

The above is not working as net.java.sip.communicator.impl.gui cannot be
included in IRC mainifest file.

-
Shobhit Jindal

---------------------------------------------------------------------
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 Emil,

Yes I totally agree!

So the best soln. will be to popup an information dialog(from UIService)
whenever user sends a /join #chatroom command.
The popup will saythat joining chatrooms by commands is not supported.
Please use Main Window -> Chatroom tab -> IRC Freendode -> Right Click ->
Join Chatroom.

whatsay?

···

-
Shobhit

So the best soln. will be to popup an information dialog(from UIService) and
say joining chatrooms by command line is not supported. Please use Main
Window -> Chatroom tab -> IRC Freendode -> Join Chatroom.

whatsay?

-
Shobhit

On Wed, Apr 2, 2008 at 2:29 PM, Emil Ivov <emcho@sip-communicator.org> wrote:

Hey Jindal,

Shobhit Jindal написа:
> Hi,
>
> Is it possible to call UI's MainFrame.getMultiUserChatManager() from
> within a protocol provider?

You could do it with some tweaking but you shouldn't. It's supposed to
go the other way. If you feel something is missing in the UI, then
that's where you should be adding it.

Hope this helps!

Cheers
Emil


#5

Hey Jindal,

I don't quite understand why users should not be able to join a channel
using the #join command.

Wouldn't it be better to simply fire an even that a new chat room has
just been opened and handle that event in the UIService?

Emil

P.S. I have to admit that I thought this was already implemented. Can't
test right now though.

Shobhit Jindal написа:

···

Hi Emil,

Yes I totally agree!

So the best soln. will be to popup an information dialog(from UIService)
whenever user sends a /join #chatroom command.
The popup will saythat joining chatrooms by commands is not supported.
Please use Main Window -> Chatroom tab -> IRC Freendode -> Right Click
-> Join Chatroom.

whatsay?
-
Shobhit

So the best soln. will be to popup an information dialog(from UIService)
and say joining chatrooms by command line is not supported. Please use
Main Window -> Chatroom tab -> IRC Freendode -> Join Chatroom.

whatsay?

-
Shobhit

On Wed, Apr 2, 2008 at 2:29 PM, Emil Ivov <emcho@sip-communicator.org > <mailto:emcho@sip-communicator.org>> wrote:

    Hey Jindal,

    Shobhit Jindal написа:
    > Hi,
    >
    > Is it possible to call UI's MainFrame.getMultiUserChatManager() from
    > within a protocol provider?

    You could do it with some tweaking but you shouldn't. It's supposed to
    go the other way. If you feel something is missing in the UI, then
    that's where you should be adding it.

    Hope this helps!

    Cheers
    Emil

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


#6

Hi,

I think Emil is right, when a chat room is joined a event is fired to all listener of chatroom events and the gui is one of this listener so the gui can handle this.

Stéphane

Emil Ivov <emcho@sip-communicator.org> a écrit :

···

Hey Jindal,

I don't quite understand why users should not be able to join a channel
using the #join command.

Wouldn't it be better to simply fire an even that a new chat room has
just been opened and handle that event in the UIService?

Emil

P.S. I have to admit that I thought this was already implemented. Can't
test right now though.

Shobhit Jindal написа:

Hi Emil,

Yes I totally agree!

So the best soln. will be to popup an information dialog(from UIService)
whenever user sends a /join #chatroom command.
The popup will saythat joining chatrooms by commands is not supported.
Please use Main Window -> Chatroom tab -> IRC Freendode -> Right Click
-> Join Chatroom.

whatsay?
-
Shobhit

So the best soln. will be to popup an information dialog(from UIService)
and say joining chatrooms by command line is not supported. Please use
Main Window -> Chatroom tab -> IRC Freendode -> Join Chatroom.

whatsay?

-
Shobhit

On Wed, Apr 2, 2008 at 2:29 PM, Emil Ivov <emcho@sip-communicator.org >> <mailto:emcho@sip-communicator.org>> wrote:

    Hey Jindal,

    Shobhit Jindal написа:
    > Hi,
    >
    > Is it possible to call UI's MainFrame.getMultiUserChatManager() from
    > within a protocol provider?

    You could do it with some tweaking but you shouldn't. It's supposed to
    go the other way. If you feel something is missing in the UI, then
    that's where you should be adding it.

    Hope this helps!

    Cheers
    Emil

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

--
Vous êtes unique, comme tout le monde!

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


#7

At the moment my whole JVM crashes when I launch SC when a Webcam is attached. Does anyone have the same experience? I think I had this problem already and one day it was away, but I cannot remember, what solved my problem.

Windows XP Professeional, Java 1.6

Cheers, thomas

···

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