. First part of the Clipboard UI refactoring ready for AVM node support

- Clipboard actions now based on NodeRef not "id"
 - Added notion of "workspace" and "AVM" specific clipboard items
 - Clipboard bean supports creating different ClipboardItem types (workspace or avm)
. ActionLink parameters are now "toString()"ed rather than assumed String
. Optimization to Portal Tree Navigator support

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4924 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-01-24 18:41:49 +00:00
parent d40af2be67
commit bd25cfa86f
10 changed files with 294 additions and 141 deletions

View File

@@ -96,16 +96,7 @@ public abstract class BaseRenderer extends Renderer
if (child instanceof UIParameter)
{
final UIParameter param = (UIParameter)child;
if (param.getValue() == null || param.getValue() instanceof String)
{
params.put(param.getName(), (String)param.getValue());
}
else
{
throw new ClassCastException("value of parameter " + param.getName() +
" is a " + param.getValue().getClass().getName() +
". Expected a " + String.class.getName());
}
params.put(param.getName(), param.getValue() != null ? param.getValue().toString() : null);
}
}
return params;

View File

@@ -160,7 +160,7 @@ public class UIClipboardShelfItem extends UIShelfItem
// start row with cut/copy state icon
out.write("<tr><td width=16>");
if (item.Mode == ClipboardStatus.COPY)
if (item.getMode() == ClipboardStatus.COPY)
{
out.write(Utils.buildImageTag(context, WebResources.IMAGE_COPY, 14, 16, bundle.getString(MSG_COPY), null, "absmiddle"));
}
@@ -170,10 +170,10 @@ public class UIClipboardShelfItem extends UIShelfItem
}
out.write("</td><td width=16>");
if (dd.isSubClass(item.Node.getType(), ContentModel.TYPE_FOLDER))
if (dd.isSubClass(item.getType(), ContentModel.TYPE_FOLDER))
{
// start row with correct node icon
String icon = (String)item.Node.getProperties().get("app:icon");
String icon = (String)item.getIcon();
if (icon != null)
{
icon = "/images/icons/" + icon + "-16.gif";
@@ -186,21 +186,21 @@ public class UIClipboardShelfItem extends UIShelfItem
}
else
{
String image = Utils.getFileTypeImage(item.Node.getName(), true);
String image = Utils.getFileTypeImage(item.getName(), true);
out.write(Utils.buildImageTag(context, image, null, "absmiddle"));
}
// output cropped item label - we also output with no breaks, this is ok
// as the copped label will ensure a sensible maximum width
out.write("</td><td width=100%><nobr>&nbsp;");
out.write(Utils.cropEncode(item.Node.getName()));
out.write(Utils.cropEncode(item.getName()));
// output actions
out.write("</nobr></td><td align=right><nobr>");
out.write(buildActionLink(ACTION_REMOVE_ITEM, i, bundle.getString(MSG_REMOVE_ITEM), WebResources.IMAGE_REMOVE));
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_ITEM, i, bundle.getString(MSG_PASTE_ITEM), WebResources.IMAGE_PASTE));
if (item.Mode == ClipboardStatus.COPY && dd.isSubClass(item.Node.getType(), ContentModel.TYPE_LINK) == false)
if (item.getMode() == ClipboardStatus.COPY && dd.isSubClass(item.getType(), ContentModel.TYPE_LINK) == false)
{
out.write("&nbsp;");
out.write(buildActionLink(ACTION_PASTE_LINK, i, bundle.getString(MSG_PASTE_LINK), WebResources.IMAGE_PASTE_LINK));