2013-02-08 10:56:27 +01:00
|
|
|
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
|
|
|
|
2013-02-13 18:43:50 +01:00
|
|
|
import java.util.List;
|
2013-02-08 10:56:27 +01:00
|
|
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
|
|
|
|
2014-07-28 16:21:45 +02:00
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
2013-02-08 10:56:27 +01:00
|
|
|
|
2018-10-09 12:16:10 +02:00
|
|
|
|
2013-02-08 10:56:27 +01:00
|
|
|
/**
|
2018-10-09 12:16:10 +02:00
|
|
|
* The Class GxtBreadcrumbPathPanel.
|
2013-02-08 10:56:27 +01:00
|
|
|
*
|
2018-10-09 12:16:10 +02:00
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
|
|
|
* Oct 9, 2018
|
2013-02-08 10:56:27 +01:00
|
|
|
*/
|
2014-02-17 19:20:45 +01:00
|
|
|
public class GxtBreadcrumbPathPanel {
|
2013-02-08 10:56:27 +01:00
|
|
|
|
2014-10-28 17:12:52 +01:00
|
|
|
private static final String ROOT_NAME = "";
|
2014-07-28 16:21:45 +02:00
|
|
|
private Breadcrumbs breadCrumbs = new Breadcrumbs(ROOT_NAME);
|
2013-02-13 18:43:50 +01:00
|
|
|
|
2018-10-09 12:16:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiates a new gxt breadcrumb path panel.
|
|
|
|
*/
|
2014-02-17 19:20:45 +01:00
|
|
|
public GxtBreadcrumbPathPanel() {
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
2018-10-09 12:16:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the tool bar path panel.
|
|
|
|
*
|
|
|
|
* @return the tool bar path panel
|
|
|
|
*/
|
2014-07-28 16:21:45 +02:00
|
|
|
public Composite getToolBarPathPanel() {
|
|
|
|
return breadCrumbs;
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
|
|
|
|
2018-10-09 12:16:10 +02:00
|
|
|
/**
|
|
|
|
* Sets the path.
|
|
|
|
*
|
|
|
|
* @param parents the new path
|
|
|
|
*/
|
2013-02-13 18:43:50 +01:00
|
|
|
public void setPath(List<FileModel> parents) {
|
2014-07-28 16:21:45 +02:00
|
|
|
breadCrumbs.setPath(parents);
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
2018-10-09 12:16:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Breadcrumb is empty.
|
|
|
|
*
|
|
|
|
* @return true, if successful
|
|
|
|
*/
|
2013-02-13 18:43:50 +01:00
|
|
|
public boolean breadcrumbIsEmpty(){
|
2014-07-28 16:21:45 +02:00
|
|
|
return breadCrumbs.breadcrumbIsEmpty();
|
2013-02-13 18:43:50 +01:00
|
|
|
}
|
2018-10-09 12:16:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the last parent.
|
|
|
|
*
|
|
|
|
* @return the last parent
|
|
|
|
*/
|
2013-02-13 18:43:50 +01:00
|
|
|
public FileModel getLastParent(){
|
2014-07-28 16:21:45 +02:00
|
|
|
return breadCrumbs.getLastParent();
|
2014-05-16 17:44:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-10-09 12:16:10 +02:00
|
|
|
* Gets the parent folder.
|
|
|
|
*
|
|
|
|
* @param folderId the folder id
|
|
|
|
* @return the parent folder
|
|
|
|
*/
|
|
|
|
public FileModel getParentFolder(String folderId){
|
|
|
|
|
|
|
|
if(folderId==null)
|
|
|
|
return null;
|
|
|
|
|
|
|
|
return breadCrumbs.getParentFolder(folderId);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh size.
|
2014-05-16 17:44:31 +02:00
|
|
|
*/
|
|
|
|
public void refreshSize() {
|
2014-07-28 16:21:45 +02:00
|
|
|
// TODO Auto-generated method stub
|
2013-02-08 10:56:27 +01:00
|
|
|
}
|
|
|
|
}
|