Patch provided by Sebastien Mazy, that enables parameter passing to exported windows in user interface.

cusax-fix
Yana Stamcheva 18 years ago
parent 5998afa9d8
commit ac3cf52ac1

@ -486,4 +486,9 @@ public Object getSource()
{
return this;
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -477,20 +477,39 @@ public Iterator getSupportedExportedWindows()
* <tt>WindowID</tt>.
*
* @param windowID the id of the window we'd like to retrieve.
*
* @param params the params to be passed to the returned window.
* @return a reference to the <tt>ExportedWindow</tt> instance corresponding
* to <tt>windowID</tt>.
* @see UIService#getExportedWindow(WindowID)
*/
public ExportedWindow getExportedWindow(WindowID windowID)
public ExportedWindow getExportedWindow(WindowID windowID, Object[] params)
{
if (exportedWindows.containsKey(windowID))
{
return (ExportedWindow) exportedWindows.get(windowID);
ExportedWindow win = (ExportedWindow) exportedWindows.get(windowID);
win.setParams(params);
return win;
}
return null;
}
/**
* Implements the <code>getExportedWindow</code> in the UIService
* interface. Returns the window corresponding to the given
* <tt>WindowID</tt>.
*
* @param windowID the id of the window we'd like to retrieve.
*
* @return a reference to the <tt>ExportedWindow</tt> instance corresponding
* to <tt>windowID</tt>.
* @see UIService#getExportedWindow(WindowID)
*/
public ExportedWindow getExportedWindow(WindowID windowID)
{
return getExportedWindow(windowID, null);
}
/**
* Implements the <code>UIService.isExportedWindowSupported</code> method.
* Checks if there's an exported component for the given

@ -1521,4 +1521,10 @@ public MainContentPane()
borderSize));
}
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -285,4 +285,8 @@ private void removeConfigurationForm(ConfigurationForm configForm)
this.configList.removeConfigForm(configForm);
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -117,4 +117,9 @@ public void setVisible(boolean isVisible)
{
getWizard().setVisible(isVisible);
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -387,4 +387,9 @@ public Object getSource()
{
return this;
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -1,3 +1,9 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.menus;
import java.awt.*;
@ -165,4 +171,9 @@ public Object getSource()
{
return this;
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -253,4 +253,9 @@ public Object getSource()
{
return this;
}
/**
* Implementation of {@link ExportedWindow#setParams(Object[])}.
*/
public void setParams(Object[] windowParams) {}
}

@ -101,4 +101,14 @@ public interface ExportedWindow
* @return the source of the window
*/
public Object getSource();
/**
* This method can be called to pass any params to the exported window. This
* method will be automatically called by
* {@link UIService#getExportedWindow(WindowID, Object[])} in order to set
* the parameters passed.
*
* @param windowParams the parameters to pass.
*/
public void setParams(Object[] windowParams);
}

@ -162,12 +162,27 @@ public interface UIService
* @throws IllegalArgumentException if the specified <tt>windowID</tt>
* is not recognized by the implementation (note that implementations
* MUST properly handle all WINDOW_XXX ID-s.
* @return the window to be shown
* @see #getSupportedExportedWindows()
* @return the window to be shown.
*/
public ExportedWindow getExportedWindow(WindowID windowID)
throws IllegalArgumentException;
/**
* Returns an exported window given by the <tt>WindowID</tt>.
* This could be for example the "Add contact" window or any other window
* within the application. The <tt>windowID</tt> should be one of the
* WINDOW_XXX obtained by the <tt>getSupportedExportedWindows</tt> method.
*
* @param windowID One of the WINDOW_XXX WindowID-s.
* @param params The parameters to be passed to the returned exported window.
* @throws IllegalArgumentException if the specified <tt>windowID</tt>
* is not recognized by the implementation (note that implementations
* MUST properly handle all WINDOW_XXX ID-s.
* @return the window to be shown.
*/
public ExportedWindow getExportedWindow(WindowID windowID, Object[] params)
throws IllegalArgumentException;
/**
* Returns a configurable popup dialog, that could be used to show either
* a warning message, error message, information message, etc. or to prompt

Loading…
Cancel
Save