256: Workspace explorer
Task-Url: https://support.d4science.org/issues/256 Updated styles and labels git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117168 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
20924445b4
commit
5f9d1078f2
|
@ -186,7 +186,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
final HorizontalPanel hp = new HorizontalPanel();
|
||||
Image iconInfo = WorkspaceExplorerResources.getIconInfo().createImage();
|
||||
iconInfo.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
|
||||
hp.add(WorkspaceExplorerResources.getIconInfo().createImage());
|
||||
hp.add(iconInfo);
|
||||
final Label labelName = new Label("Name: "+item.getName());
|
||||
double marginValue = 10.0;
|
||||
labelName.getElement().getStyle().setMarginLeft(marginValue, Unit.PX);
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
|||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.WorkspaceNavigatorServiceException;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
|||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ public class ItemsTable extends AbstractItemsCellTable {
|
|||
private TextColumn<Item> name;
|
||||
private TextColumn<Item> owner;
|
||||
private Item selectedItem = null;
|
||||
private Column<Item, ImageResource> moreInfo;
|
||||
|
||||
/**
|
||||
* Instantiates a new items table.
|
||||
|
|
|
@ -77,17 +77,18 @@ public class ItemBuilder {
|
|||
*/
|
||||
public static Item getItem(Item parent, WorkspaceItem workspaceItem, List<ItemType> showableTypes, FilterCriteria filterCriteria, boolean loadChildren) throws InternalErrorException
|
||||
{
|
||||
|
||||
_log.info("Building item for: "+workspaceItem.getName());
|
||||
|
||||
ItemType type = getItemType(workspaceItem);
|
||||
|
||||
if (!showableTypes.contains(type)) return null;
|
||||
if (!filterItem(type, workspaceItem, filterCriteria)) return null;
|
||||
|
||||
String itemName = workspaceItem.getName();
|
||||
if (workspaceItem.getName().equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL)) {
|
||||
_log.info("Building Item for: "+itemName);
|
||||
|
||||
//TODO ADD CONTROL ON THE PATH WHEN WILL BE MORE FAST
|
||||
if (itemName.equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL))
|
||||
itemName = "My VRE Folders";
|
||||
}
|
||||
|
||||
boolean isFolder = false;
|
||||
if(type.equals(ItemType.FOLDER) || type.equals(ItemType.ROOT))
|
||||
|
@ -98,9 +99,10 @@ public class ItemBuilder {
|
|||
|
||||
if(loadChildren){
|
||||
for (WorkspaceItem child: workspaceItem.getChildren()){
|
||||
Item itemChild = getItem(item, child, showableTypes, filterCriteria, false);
|
||||
_log.info("Converting child item: "+itemName);
|
||||
Item itemChild = getItem(item, child, showableTypes, filterCriteria, false);
|
||||
_log.info("Item: "+itemName +" converted!!!");
|
||||
if (itemChild!=null){
|
||||
// item.removeChild(empty);
|
||||
item.addChild(itemChild);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.portlets.widgets.wsexplorer.server;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -27,7 +26,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
|
|||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter;
|
||||
import org.gcube.portlets.widgets.wsexplorer.shared.WorkspaceNavigatorServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -48,7 +46,7 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
|
|||
*/
|
||||
public static final Logger _log = LoggerFactory.getLogger(WorkspaceExplorerServiceImpl.class);
|
||||
public static final String USERNAME_ATTRIBUTE = "username";
|
||||
public static final String TEST_USER = "test.user";
|
||||
public static final String TEST_USER = "francesco.mangiacrapa";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -229,7 +227,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
|
|||
long startTime = System.currentTimeMillis();
|
||||
_log.trace("start time - " + startTime);
|
||||
|
||||
|
||||
Item itemFolder = ItemBuilder.getItem(null, folder, showableTypes, filterCriteria, true);
|
||||
itemFolder.setName(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL);
|
||||
itemFolder.setSpecialFolder(true);
|
||||
|
@ -477,6 +474,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
|
|||
if(size == 0) return "Empty";
|
||||
final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" };
|
||||
int digitGroups = (int) (Math.log10(size)/Math.log10(1024));
|
||||
return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups];
|
||||
return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups))+units[digitGroups];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue