fox for set showable type and set selectable types
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@169597 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7358c43827
commit
23f6231ca1
|
@ -37,10 +37,13 @@ import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.dom.client.Style.VerticalAlign;
|
import com.google.gwt.dom.client.Style.VerticalAlign;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
|
@ -334,7 +337,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
||||||
*
|
*
|
||||||
* @param item the item
|
* @param item the item
|
||||||
*/
|
*/
|
||||||
private void updateMoreInfo(Item item){
|
private void updateMoreInfo(final Item item){
|
||||||
|
|
||||||
if(item!=null){
|
if(item!=null){
|
||||||
workspaceExplorerPanel.getSouthPanel().clear();
|
workspaceExplorerPanel.getSouthPanel().clear();
|
||||||
|
@ -346,7 +349,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
||||||
iconInfo.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
|
iconInfo.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
|
||||||
hp.add(iconInfo);
|
hp.add(iconInfo);
|
||||||
final Label labelName = new Label("Name: "+item.getName());
|
final Label labelName = new Label("Name: "+item.getName());
|
||||||
double marginValue = 10.0;
|
final double marginValue = 10.0;
|
||||||
labelName.getElement().getStyle().setMarginLeft(marginValue, Unit.PX);
|
labelName.getElement().getStyle().setMarginLeft(marginValue, Unit.PX);
|
||||||
labelName.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
labelName.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
||||||
final Label labelSize = new Label("Size: ");
|
final Label labelSize = new Label("Size: ");
|
||||||
|
@ -355,11 +358,26 @@ public class WorkspaceExplorerController implements EventHandler {
|
||||||
labelMime.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
labelMime.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
||||||
final Label labelACL = new Label("Rights: ");
|
final Label labelACL = new Label("Rights: ");
|
||||||
labelACL.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
labelACL.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
||||||
|
|
||||||
hp.add(labelName);
|
hp.add(labelName);
|
||||||
hp.add(labelSize);
|
hp.add(labelSize);
|
||||||
if(!item.isFolder())
|
if(!item.isFolder())
|
||||||
hp.add(labelMime);
|
hp.add(labelMime);
|
||||||
hp.add(labelACL);
|
hp.add(labelACL);
|
||||||
|
|
||||||
|
final Button showIdButton = new Button("more");
|
||||||
|
showIdButton.setSize("50px", "22px");
|
||||||
|
showIdButton.addClickHandler(new ClickHandler() {
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
final Label labelitemId = new Label("Id: " + item.getId());
|
||||||
|
hp.add(labelitemId);
|
||||||
|
labelitemId.getElement().getStyle().setMarginRight(marginValue, Unit.PX);
|
||||||
|
showIdButton.removeFromParent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
hp.add(showIdButton);
|
||||||
|
|
||||||
WorkspaceExplorerConstants.workspaceNavigatorService.getReadableSizeByItemId(item.getId(), new AsyncCallback<String>() {
|
WorkspaceExplorerConstants.workspaceNavigatorService.getReadableSizeByItemId(item.getId(), new AsyncCallback<String>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -143,8 +143,11 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
||||||
public WorkspaceResourcesExplorerPanel(String folderId, boolean showOnlyFolders) throws Exception {
|
public WorkspaceResourcesExplorerPanel(String folderId, boolean showOnlyFolders) throws Exception {
|
||||||
|
|
||||||
if(showOnlyFolders){
|
if(showOnlyFolders){
|
||||||
ItemType[] itemsType = new ItemType[1];
|
ItemType[] itemsType = new ItemType[4];
|
||||||
itemsType[0] = ItemType.FOLDER;
|
itemsType[0] = ItemType.FOLDER;
|
||||||
|
itemsType[1] = ItemType.PRIVATE_FOLDER;
|
||||||
|
itemsType[2] = ItemType.SHARED_FOLDER;
|
||||||
|
itemsType[3] = ItemType.VRE_FOLDER;
|
||||||
initExplorer(folderId, "", itemsType, itemsType, null, null, false, null);
|
initExplorer(folderId, "", itemsType, itemsType, null, null, false, null);
|
||||||
}else{
|
}else{
|
||||||
initExplorer(folderId, "", ItemType.values(), ItemType.values(), null, null, false, null);
|
initExplorer(folderId, "", ItemType.values(), ItemType.values(), null, null, false, null);
|
||||||
|
|
Loading…
Reference in New Issue