[sip-comm-dev] Re: svn commit: r4974 - trunk: resources/languages src/net/java/sip/communicator/impl/gui/main/presence/message src/net/java/sip/communicator/impl/systray


#1

Hey Alan,

Thanks so much for looking into issue #519!

However, I created the issue in question because I wanted to eliminate
one of the two almost-identical definitions and leave only one of
them. The immediate disadvantage of having these definitions is
maintenance i.e. fixing an issue in one of the definitions has to be
manually transfered to the other definitions. Then of course there's
the question of consistency - the two definitions can easily get out
of sync and they are already out of sync. For what it's worth, I just
eliminated more than a half of the fields of one of the definitions
(thus reducing the memory consumption of the instance) and marked the
rest final (thus allowing more aggressive wrt optimizations)... and
now I have to repeat these for the other definition. I think it'll be
better to keep only one of the two definitions. We could, for example,
expose the definition in .impl.gui.main.presence.message as an
ExportedWindow and then we could consume this ExportedWindow in
.impl.systray.

Anyway, the above is just a description of my intention at the time of
opening the issue, a suggestion. Please let me know what you think.

Best regards,
Lubo

···

On Fri, Feb 6, 2009 at 9:33 PM, <akelly7@dev.java.net> wrote:

Author: akelly7
Date: 2009-02-06 19:33:34+0000
New Revision: 4974

Modified:
  trunk/resources/languages/resources.properties
  trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java
  trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java
  trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java

Log:
Resolve Issue 519 and minor cosmetic changes to NewStatusMessageDialog

Modified: trunk/resources/languages/resources.properties
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/resources/languages/resources.properties?view=diff&rev=4974&p1=trunk/resources/languages/resources.properties&p2=trunk/resources/languages/resources.properties&r1=4973&r2=4974

--- trunk/resources/languages/resources.properties (original)
+++ trunk/resources/languages/resources.properties 2009-02-06 19:33:34+0000
@@ -206,6 +206,7 @@
service.gui.NEW_ACCOUNT=Add &new account
service.gui.NEW_MESSAGE=New message
service.gui.NEW_NAME=New name
+service.gui.NEW_STATUS_MESSAGE=New status message
service.gui.NO=No
service.gui.NO_AVAILABLE_ROOMS=The list of rooms for this server is currently not available.
service.gui.NO_MESSAGE=No message

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java?view=diff&rev=4974&p1=trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java&r1=4973&r2=4974

--- trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java (original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatusMessageDialog.java 2009-02-06 19:33:34+0000
@@ -86,6 +86,7 @@
        this.infoArea.setEditable(false);
        this.infoArea.setLineWrap(true);
        this.infoArea.setWrapStyleWord(true);
+ this.infoArea.setOpaque(false);

        this.dataPanel.add(messageLabel, BorderLayout.WEST);

Modified: trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java?view=diff&rev=4974&p1=trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java&p2=trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java&r1=4973&r2=4974

--- trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java (original)
+++ trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java 2009-02-06 19:33:34+0000
@@ -27,37 +27,31 @@
{
    private Logger logger = Logger.getLogger(NewStatusMessageDialog.class);

- private JPanel messagePanel = new TransparentPanel(new BorderLayout());
-
    private JLabel messageLabel = new JLabel(
- Resources.getString("service.gui.NEW_STATUS_MESSAGE"));
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.NEW_STATUS_MESSAGE"));

    private JTextField messageTextField = new JTextField();

    private JPanel dataPanel = new TransparentPanel(new BorderLayout(5, 5));

- private JTextArea infoLabel = new JTextArea(
- Resources.getString("service.gui.STATUS_MESSAGE_INFO"));
+ private JTextArea infoArea = new JTextArea(
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.STATUS_MESSAGE_INFO"));

    private JLabel infoTitleLabel = new JLabel(
- Resources.getString("service.gui.NEW_STATUS_MESSAGE"));
-
- private JLabel iconLabel = new JLabel(
- Resources.getImage("newStatusMessageIcon"));
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.NEW_STATUS_MESSAGE"));

    private JPanel labelsPanel = new TransparentPanel(new GridLayout(0, 1));

- private JPanel rightPanel = new TransparentPanel(new BorderLayout());
-
- private JButton okButton = new JButton(Resources.getString("service.gui.OK"));
+ private JButton okButton
+ = new JButton(SystrayActivator.getResources().getI18NString("service.gui.OK"));

    private JButton cancelButton = new JButton(
- Resources.getString("service.gui.CANCEL"));
+ SystrayActivator.getResources().getI18NString("service.gui.CANCEL"));

- private JPanel buttonsPanel =
- new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));
-
- private JPanel mainPanel = new TransparentPanel(new BorderLayout());
+ private JPanel buttonsPanel = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));

    private ProtocolProviderService protocolProvider;

@@ -70,9 +64,8 @@
    {
        this.protocolProvider = protocolProvider;

- this.setSize(new Dimension(520, 270));
-
        this.init();
+ pack();
    }

    /**
@@ -81,15 +74,17 @@
     */
    private void init()
    {
- this.setTitle(Resources.getString("service.gui.NEW_STATUS_MESSAGE"));
+ this.setTitle(SystrayActivator.getResources()
+ .getI18NString("service.gui.NEW_STATUS_MESSAGE"));

        this.getRootPane().setDefaultButton(okButton);

        this.setPreferredSize(new Dimension(500, 200));

- this.iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 10));
-
- this.infoLabel.setEditable(false);
+ this.infoArea.setEditable(false);
+ this.infoArea.setLineWrap(true);
+ this.infoArea.setWrapStyleWord(true);
+ this.infoArea.setOpaque(false);

        this.dataPanel.add(messageLabel, BorderLayout.WEST);

@@ -100,19 +95,36 @@
            infoTitleLabel.getFont().deriveFont(Font.BOLD, 18.0f));

        this.labelsPanel.add(infoTitleLabel);
- this.labelsPanel.add(infoLabel);
+ this.labelsPanel.add(infoArea);
        this.labelsPanel.add(dataPanel);

- this.rightPanel.add(labelsPanel, BorderLayout.NORTH);
-
- this.messagePanel.add(iconLabel, BorderLayout.WEST);
- this.messagePanel.add(rightPanel, BorderLayout.CENTER);
+ JPanel messagePanel = new TransparentPanel(new GridBagLayout());
+ GridBagConstraints messagePanelConstraints = new GridBagConstraints();
+ messagePanelConstraints.anchor = GridBagConstraints.NORTHWEST;
+ messagePanelConstraints.fill = GridBagConstraints.NONE;
+ messagePanelConstraints.gridx = 0;
+ messagePanelConstraints.gridy = 0;
+ messagePanelConstraints.insets = new Insets(5, 0, 5, 10);
+ messagePanelConstraints.weightx = 0;
+ messagePanelConstraints.weighty = 0;
+ messagePanel
+ .add(new ImageCanvas(Resources
+ .getImage("service.gui.icons.RENAME_DIALOG_ICON").getImage()),
+ messagePanelConstraints);
+ messagePanelConstraints.anchor = GridBagConstraints.NORTH;
+ messagePanelConstraints.fill = GridBagConstraints.HORIZONTAL;
+ messagePanelConstraints.gridx = 1;
+ messagePanelConstraints.insets = new Insets(0, 0, 0, 0);
+ messagePanelConstraints.weightx = 1;
+ messagePanel.add(labelsPanel, messagePanelConstraints);

        this.okButton.setName("ok");
        this.cancelButton.setName("cancel");

- this.okButton.setMnemonic(Resources.getMnemonic("service.gui.OK"));
- this.cancelButton.setMnemonic(Resources.getMnemonic("cancel"));
+ this.okButton.setMnemonic(
+ SystrayActivator.getResources().getI18nMnemonic("service.gui.OK"));
+ this.cancelButton.setMnemonic(
+ SystrayActivator.getResources().getI18nMnemonic("service.gui.CANCEL"));

        this.okButton.addActionListener(this);
        this.cancelButton.addActionListener(this);
@@ -120,10 +132,23 @@
        this.buttonsPanel.add(okButton);
        this.buttonsPanel.add(cancelButton);

- this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10));
+ JPanel mainPanel = new TransparentPanel(new GridBagLayout());
+ mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10));

- this.mainPanel.add(messagePanel, BorderLayout.NORTH);
- this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH);
+ GridBagConstraints mainPanelConstraints = new GridBagConstraints();
+ mainPanelConstraints.anchor = GridBagConstraints.NORTH;
+ mainPanelConstraints.fill = GridBagConstraints.BOTH;
+ mainPanelConstraints.gridx = 0;
+ mainPanelConstraints.gridy = 0;
+ mainPanelConstraints.weightx = 1;
+ mainPanelConstraints.weighty = 1;
+ mainPanel.add(messagePanel, mainPanelConstraints);
+ mainPanelConstraints.anchor = GridBagConstraints.SOUTHEAST;
+ mainPanelConstraints.fill = GridBagConstraints.NONE;
+ mainPanelConstraints.gridy = 1;
+ mainPanelConstraints.weightx = 0;
+ mainPanelConstraints.weighty = 0;
+ mainPanel.add(buttonsPanel, mainPanelConstraints);

        this.getContentPane().add(mainPanel);
    }
@@ -154,13 +179,8 @@
        this.messageTextField.requestFocus();
    }

- protected void close(boolean isEscaped)
- {
- cancelButton.doClick();
- }
-
    /**
- * This class allow to use a thread to change the presence status.
+ * This class allow to use a thread to change the presence status message.
     */
    private class PublishStatusMessageThread extends Thread
    {
@@ -229,4 +249,9 @@
            }
        }
    }
+
+ protected void close(boolean isEscaped)
+ {
+ cancelButton.doClick();
+ }
}

Modified: trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java?view=diff&rev=4974&p1=trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java&p2=trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java&r1=4973&r2=4974

--- trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java (original)
+++ trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java 2009-02-06 19:33:34+0000
@@ -9,6 +9,7 @@
import net.java.sip.communicator.impl.systray.jdic.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.service.systray.*;
import net.java.sip.communicator.util.*;

@@ -31,6 +32,8 @@

    private static ConfigurationService configService;

+ private static ResourceManagementService resourcesService;
+
    private static final Logger logger =
        Logger.getLogger(SystrayActivator.class);

@@ -40,7 +43,8 @@
     * @param bc The execution context of the bundle being started.
     * @throws Exception If
     */
- public void start(BundleContext bc) throws Exception
+ public void start(BundleContext bc)
+ throws Exception
    {
        bundleContext = bc;

@@ -74,7 +78,9 @@
     * listeners, unregister all services registered by the bundle, and
     * release all services used by the bundle.
     */
- public void stop(BundleContext bc) throws Exception {
+ public void stop(BundleContext bc)
+ throws Exception
+ {
    }

@@ -116,4 +122,28 @@

        return uiService;
    }
+
+ /**
+ * Returns the <tt>ResourceManagementService</tt>, through which we will
+ * access all resources.
+ *
+ * @return the <tt>ResourceManagementService</tt>, through which we will
+ * access all resources.
+ */
+ public static ResourceManagementService getResources()
+ {
+ if (resourcesService == null)
+ {
+ ServiceReference serviceReference = bundleContext
+ .getServiceReference(ResourceManagementService.class.getName());
+
+ if(serviceReference == null)
+ return null;
+
+ resourcesService = (ResourceManagementService) bundleContext
+ .getService(serviceReference);
+ }
+
+ return resourcesService;
+ }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-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


#2

Hi Lubo,

Thanks for the feedback. I originally set out to fix a number of other
problems I noticed with the window (such as a missing resource key, and a
white background on a JTextArea that needed to be transparent). While I was
at it, I figured I should fix the inconsistency, but I wasn't entirely sure
how to remove the redundancy, so I didn't do so yet. I figured if it
mattered to you, you'd speak up when I committed the changes, and I was
right :slight_smile:

But yes, we should certainly reduce the definition to a single window, not
two. What you have suggested makes sense, and I'll see if I can make the
further changes. I'm not very familiar with ExportedWindow but I'll figure
it out.

-Alan

···

-----Original Message-----

From: Lubomir Marinov [mailto:lubomir.marinov@gmail.com]

Sent: Friday, February 06, 2009 7:15 PM
To: dev@sip-communicator.dev.java.net
Subject: [sip-comm-dev] Re: svn commit: r4974 - trunk:
resources/languagessrc/net/java/sip/communicator/impl/gui/main/presence/mess
agesrc/net/java/sip/communicator/impl/systray

Hey Alan,

Thanks so much for looking into issue #519!

However, I created the issue in question because I wanted to eliminate one
of the two almost-identical definitions and leave only one of them. The
immediate disadvantage of having these definitions is maintenance i.e.
fixing an issue in one of the definitions has to be manually transfered to
the other definitions. Then of course there's the question of consistency -
the two definitions can easily get out of sync and they are already out of
sync. For what it's worth, I just eliminated more than a half of the fields
of one of the definitions (thus reducing the memory consumption of the
instance) and marked the rest final (thus allowing more aggressive wrt
optimizations)... and now I have to repeat these for the other definition. I
think it'll be better to keep only one of the two definitions. We could, for
example, expose the definition in .impl.gui.main.presence.message as an
ExportedWindow and then we could consume this ExportedWindow in
.impl.systray.

Anyway, the above is just a description of my intention at the time of
opening the issue, a suggestion. Please let me know what you think.

Best regards,
Lubo

On Fri, Feb 6, 2009 at 9:33 PM, <akelly7@dev.java.net> wrote:

Author: akelly7
Date: 2009-02-06 19:33:34+0000
New Revision: 4974

Modified:
  trunk/resources/languages/resources.properties

trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatus
MessageDialog.java

trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java

  
trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java

Log:
Resolve Issue 519 and minor cosmetic changes to NewStatusMessageDialog

Modified: trunk/resources/languages/resources.properties
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/t
runk/resources/languages/resources.properties?view=diff&rev=4974&p1=tr
unk/resources/languages/resources.properties&p2=trunk/resources/langua
ges/resources.properties&r1=4973&r2=4974

============================================================================

--- trunk/resources/languages/resources.properties (original)
+++ trunk/resources/languages/resources.properties 2009-02-06

19:33:34+0000

@@ -206,6 +206,7 @@
service.gui.NEW_ACCOUNT=Add &new account service.gui.NEW_MESSAGE=New
message service.gui.NEW_NAME=New name
+service.gui.NEW_STATUS_MESSAGE=New status message
service.gui.NO=No
service.gui.NO_AVAILABLE_ROOMS=The list of rooms for this server is

currently not available.

service.gui.NO_MESSAGE=No message

Modified:
trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/New
StatusMessageDialog.java
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/t
runk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewS
tatusMessageDialog.java?view=diff&rev=4974&p1=trunk/src/net/java/sip/c
ommunicator/impl/gui/main/presence/message/NewStatusMessageDialog.java
&p2=trunk/src/net/java/sip/communicator/impl/gui/main/presence/message
/NewStatusMessageDialog.java&r1=4973&r2=4974

============================================================================

---

trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatus
MessageDialog.java (original)

+++

trunk/src/net/java/sip/communicator/impl/gui/main/presence/message/NewStatus
MessageDialog.java 2009-02-06 19:33:34+0000

@@ -86,6 +86,7 @@
        this.infoArea.setEditable(false);
        this.infoArea.setLineWrap(true);
        this.infoArea.setWrapStyleWord(true);
+ this.infoArea.setOpaque(false);

        this.dataPanel.add(messageLabel, BorderLayout.WEST);

Modified:
trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialo
g.java
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/t
runk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog
.java?view=diff&rev=4974&p1=trunk/src/net/java/sip/communicator/impl/s
ystray/NewStatusMessageDialog.java&p2=trunk/src/net/java/sip/communica
tor/impl/systray/NewStatusMessageDialog.java&r1=4973&r2=4974

============================================================================

---

trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java
(original)

+++

trunk/src/net/java/sip/communicator/impl/systray/NewStatusMessageDialog.java
2009-02-06 19:33:34+0000

@@ -27,37 +27,31 @@
{
    private Logger logger =
Logger.getLogger(NewStatusMessageDialog.class);

- private JPanel messagePanel = new TransparentPanel(new

BorderLayout());

-
    private JLabel messageLabel = new JLabel(
- Resources.getString("service.gui.NEW_STATUS_MESSAGE"));
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.NEW_STATUS_MESSAGE"));

    private JTextField messageTextField = new JTextField();

    private JPanel dataPanel = new TransparentPanel(new
BorderLayout(5, 5));

- private JTextArea infoLabel = new JTextArea(
- Resources.getString("service.gui.STATUS_MESSAGE_INFO"));
+ private JTextArea infoArea = new JTextArea(
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.STATUS_MESSAGE_INFO"));

    private JLabel infoTitleLabel = new JLabel(
- Resources.getString("service.gui.NEW_STATUS_MESSAGE"));
-
- private JLabel iconLabel = new JLabel(
- Resources.getImage("newStatusMessageIcon"));
+ SystrayActivator.getResources().getI18NString(
+ "service.gui.NEW_STATUS_MESSAGE"));

    private JPanel labelsPanel = new TransparentPanel(new
GridLayout(0, 1));

- private JPanel rightPanel = new TransparentPanel(new BorderLayout());
-
- private JButton okButton = new

JButton(Resources.getString("service.gui.OK"));

+ private JButton okButton
+ = new
+ JButton(SystrayActivator.getResources().getI18NString("service.gui.O
+ K"));

    private JButton cancelButton = new JButton(
- Resources.getString("service.gui.CANCEL"));
+
+ SystrayActivator.getResources().getI18NString("service.gui.CANCEL"))
+ ;

- private JPanel buttonsPanel =
- new TransparentPanel(new FlowLayout(FlowLayout.RIGHT));
-
- private JPanel mainPanel = new TransparentPanel(new BorderLayout());
+ private JPanel buttonsPanel = new TransparentPanel(new
+ FlowLayout(FlowLayout.RIGHT));

    private ProtocolProviderService protocolProvider;

@@ -70,9 +64,8 @@
    {
        this.protocolProvider = protocolProvider;

- this.setSize(new Dimension(520, 270));
-
        this.init();
+ pack();
    }

    /**
@@ -81,15 +74,17 @@
     */
    private void init()
    {
-

this.setTitle(Resources.getString("service.gui.NEW_STATUS_MESSAGE"));

+ this.setTitle(SystrayActivator.getResources()
+ .getI18NString("service.gui.NEW_STATUS_MESSAGE"));

        this.getRootPane().setDefaultButton(okButton);

        this.setPreferredSize(new Dimension(500, 200));

- this.iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5,

10));

-
- this.infoLabel.setEditable(false);
+ this.infoArea.setEditable(false);
+ this.infoArea.setLineWrap(true);
+ this.infoArea.setWrapStyleWord(true);
+ this.infoArea.setOpaque(false);

        this.dataPanel.add(messageLabel, BorderLayout.WEST);

@@ -100,19 +95,36 @@
            infoTitleLabel.getFont().deriveFont(Font.BOLD, 18.0f));

        this.labelsPanel.add(infoTitleLabel);
- this.labelsPanel.add(infoLabel);
+ this.labelsPanel.add(infoArea);
        this.labelsPanel.add(dataPanel);

- this.rightPanel.add(labelsPanel, BorderLayout.NORTH);
-
- this.messagePanel.add(iconLabel, BorderLayout.WEST);
- this.messagePanel.add(rightPanel, BorderLayout.CENTER);
+ JPanel messagePanel = new TransparentPanel(new GridBagLayout());
+ GridBagConstraints messagePanelConstraints = new

GridBagConstraints();

+ messagePanelConstraints.anchor = GridBagConstraints.NORTHWEST;
+ messagePanelConstraints.fill = GridBagConstraints.NONE;
+ messagePanelConstraints.gridx = 0;
+ messagePanelConstraints.gridy = 0;
+ messagePanelConstraints.insets = new Insets(5, 0, 5, 10);
+ messagePanelConstraints.weightx = 0;
+ messagePanelConstraints.weighty = 0;
+ messagePanel
+ .add(new ImageCanvas(Resources
+

.getImage("service.gui.icons.RENAME_DIALOG_ICON").getImage()),

+ messagePanelConstraints);
+ messagePanelConstraints.anchor = GridBagConstraints.NORTH;
+ messagePanelConstraints.fill = GridBagConstraints.HORIZONTAL;
+ messagePanelConstraints.gridx = 1;
+ messagePanelConstraints.insets = new Insets(0, 0, 0, 0);
+ messagePanelConstraints.weightx = 1;
+ messagePanel.add(labelsPanel, messagePanelConstraints);

        this.okButton.setName("ok");
        this.cancelButton.setName("cancel");

-

this.okButton.setMnemonic(Resources.getMnemonic("service.gui.OK"));

- this.cancelButton.setMnemonic(Resources.getMnemonic("cancel"));
+ this.okButton.setMnemonic(
+

SystrayActivator.getResources().getI18nMnemonic("service.gui.OK"));

+ this.cancelButton.setMnemonic(
+
+ SystrayActivator.getResources().getI18nMnemonic("service.gui.CANCEL"
+ ));

        this.okButton.addActionListener(this);
        this.cancelButton.addActionListener(this);
@@ -120,10 +132,23 @@
        this.buttonsPanel.add(okButton);
        this.buttonsPanel.add(cancelButton);

- this.mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10,

0, 10));

+ JPanel mainPanel = new TransparentPanel(new GridBagLayout());
+ mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 0,
+ 10));

- this.mainPanel.add(messagePanel, BorderLayout.NORTH);
- this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH);
+ GridBagConstraints mainPanelConstraints = new

GridBagConstraints();

+ mainPanelConstraints.anchor = GridBagConstraints.NORTH;
+ mainPanelConstraints.fill = GridBagConstraints.BOTH;
+ mainPanelConstraints.gridx = 0;
+ mainPanelConstraints.gridy = 0;
+ mainPanelConstraints.weightx = 1;
+ mainPanelConstraints.weighty = 1;
+ mainPanel.add(messagePanel, mainPanelConstraints);
+ mainPanelConstraints.anchor = GridBagConstraints.SOUTHEAST;
+ mainPanelConstraints.fill = GridBagConstraints.NONE;
+ mainPanelConstraints.gridy = 1;
+ mainPanelConstraints.weightx = 0;
+ mainPanelConstraints.weighty = 0;
+ mainPanel.add(buttonsPanel, mainPanelConstraints);

        this.getContentPane().add(mainPanel);
    }
@@ -154,13 +179,8 @@
        this.messageTextField.requestFocus();
    }

- protected void close(boolean isEscaped)
- {
- cancelButton.doClick();
- }
-
    /**
- * This class allow to use a thread to change the presence status.
+ * This class allow to use a thread to change the presence status

message.

     */
    private class PublishStatusMessageThread extends Thread
    {
@@ -229,4 +249,9 @@
            }
        }
    }
+
+ protected void close(boolean isEscaped)
+ {
+ cancelButton.doClick();
+ }
}

Modified:
trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/t
runk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java?
view=diff&rev=4974&p1=trunk/src/net/java/sip/communicator/impl/systray
/SystrayActivator.java&p2=trunk/src/net/java/sip/communicator/impl/sys
tray/SystrayActivator.java&r1=4973&r2=4974

============================================================================

--- trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java

(original)

+++ trunk/src/net/java/sip/communicator/impl/systray/SystrayActivator.java

2009-02-06 19:33:34+0000

@@ -9,6 +9,7 @@
import net.java.sip.communicator.impl.systray.jdic.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.service.systray.*;
import net.java.sip.communicator.util.*;

@@ -31,6 +32,8 @@

    private static ConfigurationService configService;

+ private static ResourceManagementService resourcesService;
+
    private static final Logger logger =
        Logger.getLogger(SystrayActivator.class);

@@ -40,7 +43,8 @@
     * @param bc The execution context of the bundle being started.
     * @throws Exception If
     */
- public void start(BundleContext bc) throws Exception
+ public void start(BundleContext bc)
+ throws Exception
    {
        bundleContext = bc;

@@ -74,7 +78,9 @@
     * listeners, unregister all services registered by the bundle, and
     * release all services used by the bundle.
     */
- public void stop(BundleContext bc) throws Exception {
+ public void stop(BundleContext bc)
+ throws Exception
+ {
    }

@@ -116,4 +122,28 @@

        return uiService;
    }
+
+ /**
+ * Returns the <tt>ResourceManagementService</tt>, through which we

will

+ * access all resources.
+ *
+ * @return the <tt>ResourceManagementService</tt>, through which we

will

+ * access all resources.
+ */
+ public static ResourceManagementService getResources()
+ {
+ if (resourcesService == null)
+ {
+ ServiceReference serviceReference = bundleContext
+
+ .getServiceReference(ResourceManagementService.class.getName());
+
+ if(serviceReference == null)
+ return null;
+
+ resourcesService = (ResourceManagementService) bundleContext
+ .getService(serviceReference);
+ }
+
+ return resourcesService;
+ }
}

---------------------------------------------------------------------
To unsubscribe, e-mail:
commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
commits-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

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