bug fixed icons
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@71868 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
568a838682
commit
c0bf5198bb
|
@ -921,7 +921,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
|
|
||||||
//Timer is used for chrome
|
//Timer is used as work around to chrome and safari browser
|
||||||
Timer t = new Timer() {
|
Timer t = new Timer() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Schedule the timer to run once every second, 1000 ms.
|
// Schedule the timer to run after 250 ms.
|
||||||
t.schedule(250);
|
t.schedule(250);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ public class ConstantsExplorer {
|
||||||
public static final String NAME = "Name";
|
public static final String NAME = "Name";
|
||||||
public static final String TYPE = "Type";
|
public static final String TYPE = "Type";
|
||||||
public static final String ICON = "Icon";
|
public static final String ICON = "Icon";
|
||||||
|
public static final String ABSTRACTICON = "Abstract Icon";
|
||||||
public static final String SHORTCUTCATEGORY = "Category";
|
public static final String SHORTCUTCATEGORY = "Category";
|
||||||
// public static final String GRIDCOLUMNTYPE = "Type";
|
// public static final String GRIDCOLUMNTYPE = "Type";
|
||||||
public static final String IDENTIFIER = "identifier";
|
public static final String IDENTIFIER = "identifier";
|
||||||
|
@ -172,7 +173,7 @@ public class ConstantsExplorer {
|
||||||
public static final String ID = "id";
|
public static final String ID = "id";
|
||||||
public static final String ATTACHS = "Attachs";
|
public static final String ATTACHS = "Attachs";
|
||||||
public static final Object NONE = "None";
|
public static final Object NONE = "None";
|
||||||
public static final String ABSTRACTICON = "Abstract Icon";
|
|
||||||
|
|
||||||
public static final NumberFormat numberFormatterKB = NumberFormat.getFormat("#,##0 KB;(#,##0 KB)");
|
public static final NumberFormat numberFormatterKB = NumberFormat.getFormat("#,##0 KB;(#,##0 KB)");
|
||||||
|
|
||||||
|
|
|
@ -118,32 +118,21 @@ public class FileModel extends BaseModelData implements Serializable {
|
||||||
|
|
||||||
public void setIcon() {
|
public void setIcon() {
|
||||||
|
|
||||||
AbstractImagePrototype absImgPr = Resources.getIconTable();
|
Image icon = (Image) get(ConstantsExplorer.ICON);
|
||||||
|
AbstractImagePrototype iconAbs;
|
||||||
if (!this.isDirectory()) { //IS FILE
|
if(icon==null)
|
||||||
if(this.getType()!=null)
|
iconAbs = getAbstractPrototypeIcon();
|
||||||
absImgPr = Resources.getIconByType(this.getType());
|
|
||||||
else
|
else
|
||||||
absImgPr = Resources.getIconByFolderItemType(this.getGXTFolderItemType());
|
return;
|
||||||
|
|
||||||
}else if(this.isShared()){ //SHARED ITEM?
|
set(ConstantsExplorer.ICON, iconAbs.createImage());
|
||||||
|
set(ConstantsExplorer.ABSTRACTICON, iconAbs);
|
||||||
if(this.isShareable()) //IS ROOT SHARED FOLDER
|
|
||||||
absImgPr = Resources.getIconSharedFolder();
|
|
||||||
else
|
|
||||||
absImgPr = Resources.getIconFolder(); //IS A DESCENDANT
|
|
||||||
|
|
||||||
|
|
||||||
}else if(this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD){ //IS A FOLDER IN LOADING
|
|
||||||
absImgPr = Resources.getIconLoading2();
|
|
||||||
|
|
||||||
}else{//SIMPLE FOLDER
|
|
||||||
absImgPr = Resources.getIconFolder();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set(ConstantsExplorer.ICON, absImgPr.createImage());
|
// public void resetIcons(){
|
||||||
set(ConstantsExplorer.ABSTRACTICON, absImgPr);
|
// set(ConstantsExplorer.ICON,null);
|
||||||
}
|
// set(ConstantsExplorer.ABSTRACTICON, null);
|
||||||
|
// }
|
||||||
|
|
||||||
public void setOwner(InfoContactModel owner){
|
public void setOwner(InfoContactModel owner){
|
||||||
set(ConstantsExplorer.OWNER, owner);
|
set(ConstantsExplorer.OWNER, owner);
|
||||||
|
@ -190,15 +179,49 @@ public class FileModel extends BaseModelData implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
public Image getIcon() {
|
public Image getIcon() {
|
||||||
return (Image) get(ConstantsExplorer.ICON);
|
return getAbstractPrototypeIcon().createImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractImagePrototype getAbstractPrototypeIcon() {
|
public AbstractImagePrototype getAbstractPrototypeIcon() {
|
||||||
if((AbstractImagePrototype) get(ConstantsExplorer.ABSTRACTICON)==null)
|
|
||||||
setIcon();
|
AbstractImagePrototype absImgPr = Resources.getIconTable();
|
||||||
return (AbstractImagePrototype) get(ConstantsExplorer.ABSTRACTICON);
|
|
||||||
|
if (!this.isDirectory()) { //IS FILE
|
||||||
|
if(this.getType()!=null)
|
||||||
|
absImgPr = Resources.getIconByType(this.getType());
|
||||||
|
else
|
||||||
|
absImgPr = Resources.getIconByFolderItemType(this.getGXTFolderItemType());
|
||||||
|
|
||||||
|
}else if(this.isShared()){ //SHARED ITEM?
|
||||||
|
|
||||||
|
if(this.isShareable()) //IS ROOT SHARED FOLDER
|
||||||
|
absImgPr = Resources.getIconSharedFolder();
|
||||||
|
else
|
||||||
|
absImgPr = Resources.getIconFolder(); //IS A DESCENDANT
|
||||||
|
|
||||||
|
|
||||||
|
}else if(this.getStatus() == ConstantsExplorer.FOLDERNOTLOAD){ //IS A FOLDER IN LOADING
|
||||||
|
absImgPr = Resources.getIconLoading2();
|
||||||
|
|
||||||
|
}else{//SIMPLE FOLDER
|
||||||
|
absImgPr = Resources.getIconFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return absImgPr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// public Image getIcon() {
|
||||||
|
// return (Image) get(ConstantsExplorer.ICON);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public AbstractImagePrototype getAbstractPrototypeIcon() {
|
||||||
|
// if((AbstractImagePrototype) get(ConstantsExplorer.ABSTRACTICON)==null)
|
||||||
|
// setIcon();
|
||||||
|
// return (AbstractImagePrototype) get(ConstantsExplorer.ABSTRACTICON);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return get("status");
|
return get("status");
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class DialogGetInfo extends Dialog {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("fileModel in getinfo "+fileModel);
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FileGridModel> getFolderChildrenForFileGrid(FileModel folder) throws Exception {
|
public List<FileGridModel> getFolderChildrenForFileGrid(FileModel folder) throws Exception {
|
||||||
|
|
||||||
Workspace workspace;
|
Workspace workspace;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -279,7 +278,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
workspaceLogger.error("Error in server During items retrieving", e);
|
workspaceLogger.error("Error in server During items retrieving", e);
|
||||||
// workspaceLogger.trace("Error in server During items retrieving " + e);
|
// workspaceLogger.trace("Error in server During items retrieving " + e);
|
||||||
|
e.printStackTrace();
|
||||||
//GWT can't serialize all exceptions
|
//GWT can't serialize all exceptions
|
||||||
throw new Exception("Error during item loading, please contact the support.");
|
throw new Exception("Error during item loading, please contact the support.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue