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
|
||||
public void onSuccess(List<FileModel> result) {
|
||||
|
||||
if(isLastParent && item.isDirectory()){
|
||||
if(isLastParent && item.isDirectory() && !item.isRoot()){
|
||||
result.add(item);
|
||||
}
|
||||
updateBreadcrumb(result); //Set file path in tab panel on current item selected
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.gcube.portlets.user.workspace.client.model.FileModel;
|
|||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class LoadBreadcrumbEvent extends GwtEvent<LoadBreadcrumbEventHandler> {
|
||||
public static Type<LoadBreadcrumbEventHandler> TYPE = new Type<LoadBreadcrumbEventHandler>();
|
||||
|
@ -19,7 +19,7 @@ public class LoadBreadcrumbEvent extends GwtEvent<LoadBreadcrumbEventHandler> {
|
|||
return fileModel;
|
||||
}
|
||||
|
||||
public LoadBreadcrumbEvent(FileModel item) {
|
||||
public LoadBreadcrumbEvent(FileModel item, boolean addAsLastParent) {
|
||||
this.fileModel = item;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
||||
|
||||
|
@ -28,7 +28,7 @@ import com.google.gwt.user.client.ui.Widget;
|
|||
* Dec 14, 2015
|
||||
*/
|
||||
public class Breadcrumbs extends Composite {
|
||||
|
||||
|
||||
public static final String DIVIDER = ">";
|
||||
private String rootName;
|
||||
private LinkedHashMap<String, FileModel> hashFileModel = new LinkedHashMap<String, FileModel>();// Ordered-HashMap
|
||||
|
@ -57,7 +57,7 @@ public class Breadcrumbs extends Composite {
|
|||
initWidget(uiBinder.createAndBindUi(this));
|
||||
breadcrumbs.setDivider(DIVIDER);
|
||||
// initBreadcrumb(true);
|
||||
|
||||
|
||||
Element ul = this.getElement().getFirstChildElement();
|
||||
ul.removeClassName("breadcrumb");
|
||||
ul.addClassName("Breadcrumbs-Personal");
|
||||
|
@ -77,8 +77,10 @@ public class Breadcrumbs extends Composite {
|
|||
hashFileModel = new LinkedHashMap<String, FileModel>();
|
||||
|
||||
for (FileModel parent : parents) {
|
||||
addNavigationLink(parent);
|
||||
hashFileModel.put(parent.getIdentifier(), parent);
|
||||
if(parent!=null){
|
||||
addNavigationLink(parent);
|
||||
hashFileModel.put(parent.getIdentifier(), parent);
|
||||
}
|
||||
}
|
||||
|
||||
lastParent = parents.get(parents.size() - 1);
|
||||
|
@ -101,7 +103,7 @@ public class Breadcrumbs extends Composite {
|
|||
* @param parent the parent
|
||||
*/
|
||||
public void addNavigationLink(FileModel parent) {
|
||||
if (! parent.isRoot()) {
|
||||
/*if (!parent.isRoot()) {
|
||||
final NavLink navLink = new NavLink(parent.getName());
|
||||
navLink.setName(parent.getIdentifier());
|
||||
breadcrumbs.add(navLink);
|
||||
|
@ -118,7 +120,21 @@ public class Breadcrumbs extends Composite {
|
|||
} else {
|
||||
final NavLink navLink = new 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