From df5f1217ff6adc0e62408c06fe720d58ed011b19 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 7 Oct 2016 15:18:01 +0000 Subject: [PATCH] Fixed shortcut category git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@132929 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../workspace/client/model/FileModel.java | 19 +++++++++++++++++-- .../client/view/windows/DialogGetInfo.java | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java b/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java index 05761f2..90ae142 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/model/FileModel.java @@ -50,6 +50,7 @@ public class FileModel extends BaseModelData implements Serializable { public static final String QUERY = "query"; public static final String OWNER = "Owner"; public static final String OWNERFULLNAME = "Owner Name"; + public static final String HUMAN_REDABLE_CATEGORY = "HR Category"; /** * Instantiates a new file model. @@ -374,15 +375,18 @@ public class FileModel extends BaseModelData implements Serializable { */ public void setShortcutCategory(GXTCategorySmartFolder smfDocuments) { set(SHORTCUTCATEGORY, smfDocuments); + if(smfDocuments!=null) + set(HUMAN_REDABLE_CATEGORY, smfDocuments.getValue()); } + /** * Gets the shortcut category. * * @return the shortcut category */ - public String getShortcutCategory(){ - return get(SHORTCUTCATEGORY).toString(); + public GXTCategorySmartFolder getShortcutCategory(){ + return (GXTCategorySmartFolder) get(SHORTCUTCATEGORY); } @@ -425,6 +429,12 @@ public class FileModel extends BaseModelData implements Serializable { /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ + /** + * Equals. + * + * @param obj the obj + * @return true, if successful + */ @Override public boolean equals(Object obj) { if (obj != null && obj instanceof FileModel) { @@ -538,6 +548,11 @@ public class FileModel extends BaseModelData implements Serializable { /* (non-Javadoc) * @see java.lang.Object#toString() */ + /** + * To string. + * + * @return the string + */ @Override public String toString() { StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java index 49abc58..c942f77 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfo.java @@ -171,7 +171,8 @@ public class DialogGetInfo extends Dialog { txtCategory = new TextField(); txtCategory.setFieldLabel("Category"); txtCategory.setReadOnly(true); - textFieldSetValue(txtCategory,fileModel.getShortcutCategory()); + if(fileModel.getShortcutCategory()!=null) + textFieldSetValue(txtCategory,fileModel.getShortcutCategory().getValue()); add(txtCategory); txtOwner = new TextField();