Fixed Bug #5218
Added Workspace root to the Breadcrumb git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@132174 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b16d2fb5f9
commit
c2177a66ab
|
@ -1082,7 +1082,7 @@ public class AppController implements SubscriberInterface {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<FileModel> result) {
|
public void onSuccess(List<FileModel> result) {
|
||||||
|
|
||||||
if(isLastParent && item.isDirectory()){
|
if(isLastParent && item.isDirectory() && !item.isRoot()){
|
||||||
result.add(item);
|
result.add(item);
|
||||||
}
|
}
|
||||||
updateBreadcrumb(result); //Set file path in tab panel on current item selected
|
updateBreadcrumb(result); //Set file path in tab panel on current item selected
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class LoadBreadcrumbEvent extends GwtEvent<LoadBreadcrumbEventHandler> {
|
||||||
return fileModel;
|
return fileModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoadBreadcrumbEvent(FileModel item) {
|
public LoadBreadcrumbEvent(FileModel item, boolean addAsLastParent) {
|
||||||
this.fileModel = item;
|
this.fileModel = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,8 +77,10 @@ public class Breadcrumbs extends Composite {
|
||||||
hashFileModel = new LinkedHashMap<String, FileModel>();
|
hashFileModel = new LinkedHashMap<String, FileModel>();
|
||||||
|
|
||||||
for (FileModel parent : parents) {
|
for (FileModel parent : parents) {
|
||||||
addNavigationLink(parent);
|
if(parent!=null){
|
||||||
hashFileModel.put(parent.getIdentifier(), parent);
|
addNavigationLink(parent);
|
||||||
|
hashFileModel.put(parent.getIdentifier(), parent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lastParent = parents.get(parents.size() - 1);
|
lastParent = parents.get(parents.size() - 1);
|
||||||
|
@ -101,7 +103,7 @@ public class Breadcrumbs extends Composite {
|
||||||
* @param parent the parent
|
* @param parent the parent
|
||||||
*/
|
*/
|
||||||
public void addNavigationLink(FileModel parent) {
|
public void addNavigationLink(FileModel parent) {
|
||||||
if (! parent.isRoot()) {
|
/*if (!parent.isRoot()) {
|
||||||
final NavLink navLink = new NavLink(parent.getName());
|
final NavLink navLink = new NavLink(parent.getName());
|
||||||
navLink.setName(parent.getIdentifier());
|
navLink.setName(parent.getIdentifier());
|
||||||
breadcrumbs.add(navLink);
|
breadcrumbs.add(navLink);
|
||||||
|
@ -118,7 +120,21 @@ public class Breadcrumbs extends Composite {
|
||||||
} else {
|
} else {
|
||||||
final NavLink navLink = new NavLink("");
|
final NavLink navLink = new NavLink("");
|
||||||
breadcrumbs.add(navLink);
|
breadcrumbs.add(navLink);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
final NavLink navLink = new NavLink(parent.getName());
|
||||||
|
navLink.setName(parent.getIdentifier());
|
||||||
|
breadcrumbs.add(navLink);
|
||||||
|
|
||||||
|
navLink.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
|
FileModel target = hashFileModel.get(navLink.getName());
|
||||||
|
AppController.getEventBus().fireEvent(new PathElementSelectedEvent(target));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue