diff options
author | Yana Stamcheva <yana@jitsi.org> | 2011-05-04 14:17:09 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2011-05-04 14:17:09 +0000 |
commit | 4bdd4a427c8943e10e40be99f400d98711892d36 (patch) | |
tree | 4556db737236d05e8bdd00e3bdf4ed32c134e4c9 /src | |
parent | fdca40b3524733758d53693664a8bc812fc77d98 (diff) | |
download | jitsi-4bdd4a427c8943e10e40be99f400d98711892d36.zip jitsi-4bdd4a427c8943e10e40be99f400d98711892d36.tar.gz jitsi-4bdd4a427c8943e10e40be99f400d98711892d36.tar.bz2 |
Allow configuration forms the revalidate configuration window, thus refreshing window size and revalidating panels.
Diffstat (limited to 'src')
3 files changed, 36 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java index e2f25f5..0a3e0a1 100644 --- a/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java +++ b/src/net/java/sip/communicator/impl/gui/main/configforms/ConfigurationFrame.java @@ -212,7 +212,7 @@ public class ConfigurationFrame { this.centerPanel.removeAll(); - JComponent configFormPanel + final JComponent configFormPanel = (JComponent) configFormDescriptor.getConfigFormPanel(); configFormPanel.setOpaque(false); @@ -331,4 +331,25 @@ public class ConfigurationFrame { configList.setSelected(configForm); } + + /** + * Validates the currently selected configuration form. This method is meant + * to be used by configuration forms the re-validate when a new component + * has been added or size has changed. + */ + public void validateCurrentForm() + { + centerPanel.revalidate(); + + centerPanel.setPreferredSize(null); + + validate(); + + // Set the height of the center panel to be equal to the height of the + // currently contained panel + all borders. + centerPanel.setPreferredSize( + new Dimension(550, centerPanel.getHeight())); + + pack(); + } } diff --git a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java index f80b340..262f9b5 100644 --- a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java @@ -394,4 +394,11 @@ public class AdvancedConfigurationPanel { return true; } + + /** + * Validates the currently selected configuration form. This method is meant + * to be used by configuration forms the re-validate when a new component + * has been added or size has changed. + */ + public void validateCurrentForm() {} } diff --git a/src/net/java/sip/communicator/service/gui/ConfigurationContainer.java b/src/net/java/sip/communicator/service/gui/ConfigurationContainer.java index ed94a1b..236f58a 100644 --- a/src/net/java/sip/communicator/service/gui/ConfigurationContainer.java +++ b/src/net/java/sip/communicator/service/gui/ConfigurationContainer.java @@ -18,4 +18,11 @@ public interface ConfigurationContainer * @param configForm the <tt>ConfigurationForm</tt> to select */ public void setSelected(ConfigurationForm configForm); + + /** + * Validates the currently selected configuration form. This method is meant + * to be used by configuration forms the re-validate when a new component + * has been added or size has changed. + */ + public void validateCurrentForm(); } |