mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Big honkin' merge from head. Sheesh!
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -67,6 +67,7 @@ public class UIGenericPicker extends UICommand
|
||||
private Boolean showContains = null;
|
||||
private Boolean showAddButton = null;
|
||||
private Boolean filterRefresh = null;
|
||||
private Boolean multiSelect = null;
|
||||
private String addButtonLabel;
|
||||
private Integer width = null;
|
||||
private Integer height = null;
|
||||
@@ -118,6 +119,7 @@ public class UIGenericPicker extends UICommand
|
||||
currentResults = (SelectItem[])values[11];
|
||||
filters = (SelectItem[])values[12];
|
||||
filterRefresh = (Boolean)values[13];
|
||||
multiSelect = (Boolean)values[14];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +127,7 @@ public class UIGenericPicker extends UICommand
|
||||
*/
|
||||
public Object saveState(FacesContext context)
|
||||
{
|
||||
Object values[] = new Object[14];
|
||||
Object values[] = new Object[15];
|
||||
// standard component attributes are saved by the super class
|
||||
values[0] = super.saveState(context);
|
||||
values[1] = showFilter;
|
||||
@@ -141,6 +143,7 @@ public class UIGenericPicker extends UICommand
|
||||
values[11] = currentResults;
|
||||
values[12] = filters;
|
||||
values[13] = filterRefresh;
|
||||
values[14] = multiSelect;
|
||||
return (values);
|
||||
}
|
||||
|
||||
@@ -221,7 +224,7 @@ public class UIGenericPicker extends UICommand
|
||||
{
|
||||
// use reflection to execute the query callback method and retrieve results
|
||||
Object result = callback.invoke(getFacesContext(), new Object[] {
|
||||
this.filterIndex, this.contains});
|
||||
this.filterIndex, this.contains.trim()});
|
||||
|
||||
if (result instanceof SelectItem[])
|
||||
{
|
||||
@@ -354,7 +357,14 @@ public class UIGenericPicker extends UICommand
|
||||
out.write(Integer.toString(getHeight()));
|
||||
out.write("px' name='");
|
||||
out.write(clientId + FIELD_RESULTS);
|
||||
out.write("' multiple>");
|
||||
out.write("' id='");
|
||||
out.write(clientId + FIELD_RESULTS);
|
||||
out.write("'");
|
||||
if (getMultiSelect() == true)
|
||||
{
|
||||
out.write(" multiple");
|
||||
}
|
||||
out.write(">");
|
||||
|
||||
// results
|
||||
if (currentResults != null)
|
||||
@@ -530,6 +540,28 @@ public class UIGenericPicker extends UICommand
|
||||
this.filterRefresh = Boolean.valueOf(filterRefresh);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if multi select should be enabled.
|
||||
*/
|
||||
public boolean getMultiSelect()
|
||||
{
|
||||
ValueBinding vb = getValueBinding("multiSelect");
|
||||
if (vb != null)
|
||||
{
|
||||
this.multiSelect = (Boolean)vb.getValue(getFacesContext());
|
||||
}
|
||||
|
||||
return multiSelect != null ? multiSelect.booleanValue() : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param multiSelect Flag to determine whether multi select is enabled
|
||||
*/
|
||||
public void setMultiSelect(boolean multiSelect)
|
||||
{
|
||||
this.multiSelect = Boolean.valueOf(multiSelect);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the width.
|
||||
*/
|
||||
@@ -633,6 +665,7 @@ public class UIGenericPicker extends UICommand
|
||||
/**
|
||||
* Class representing the an action relevant to the Generic Selector component.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public static class PickerEvent extends ActionEvent
|
||||
{
|
||||
public PickerEvent(UIComponent component, int action, int filterIndex, String contains, String[] results)
|
||||
|
@@ -101,6 +101,10 @@ public class UIPanel extends UICommand
|
||||
|
||||
// determine whether we have any adornments
|
||||
String label = getLabel();
|
||||
if (label != null)
|
||||
{
|
||||
label = Utils.encode(label);
|
||||
}
|
||||
if (label != null || isProgressive() == true || titleComponent != null)
|
||||
{
|
||||
this.hasAdornments = true;
|
||||
@@ -156,11 +160,11 @@ public class UIPanel extends UICommand
|
||||
|
||||
if (isExpanded() == true)
|
||||
{
|
||||
out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, ""));
|
||||
out.write(Utils.buildImageTag(context, WebResources.IMAGE_EXPANDED, 11, 11, label));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, ""));
|
||||
out.write(Utils.buildImageTag(context, WebResources.IMAGE_COLLAPSED, 11, 11, label));
|
||||
}
|
||||
|
||||
out.write("</a> ");
|
||||
@@ -174,11 +178,11 @@ public class UIPanel extends UICommand
|
||||
Utils.outputAttribute(out, getAttributes().get("styleClass"), "class");
|
||||
out.write('>');
|
||||
|
||||
out.write(Utils.encode(label));
|
||||
out.write(label); // already encoded above
|
||||
|
||||
out.write("</span>");
|
||||
}
|
||||
|
||||
|
||||
if (this.hasAdornments)
|
||||
{
|
||||
out.write("</td>");
|
||||
|
Reference in New Issue
Block a user