Added collapsible tree panel when window width is lower than a given value in pixels and shifted download button next to the upload one

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@146828 82a268e6-3cf1-43bd-a215-b396298e98cf
task/19600
Massimiliano Assante 7 years ago
parent d1c87fcf34
commit d7419fbf43

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/workspace-6.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/workspace-6.17.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/workspace-6.16.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/workspace-6.17.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -34,5 +34,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/workspace-6.16.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/workspace-6.17.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -3,6 +3,6 @@
>>>>>>>=.r93212
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francesco-mangiacrapa/wseclipseluna/workspace-TRUNK/target/workspace-6.9.0-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/workspace/target/workspace-6.17.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

@ -5,6 +5,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.16.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree/WorkspaceTree">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/>

@ -61,5 +61,7 @@ public class ConstantsPortlet {
public static final int NORTH_HEIGHT = 82;
//Tree Panel
public static final int HIDE_TREE_PANEL_WHEN_WIDTH_LESS_THAN = 650;
}

@ -1,6 +1,7 @@
package org.gcube.portlets.user.workspace.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
@ -27,7 +28,7 @@ public class WorkspacePortlet implements EntryPoint {
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
System.out.println("onWindowResized width: "+event.getWidth()+" height: "+event.getHeight());
GWT.log("onWindowResized width: "+event.getWidth()+" height: "+event.getHeight());
updateSize();
}
});
@ -51,9 +52,13 @@ public class WorkspacePortlet implements EntryPoint {
rootHeight = 550;
int rootWidth = Window.getClientWidth() - 2* leftBorder; //- rightScrollBar;
System.out.println("New workspace dimension Height: "+rootHeight+" Width: "+rootWidth);
GWT.log("New workspace dimension Height: "+rootHeight+" Width: "+rootWidth);
appController.getMainPanel().setHeight(rootHeight);
appController.getMainPanel().setWidth(rootWidth);
if (rootWidth < ConstantsPortlet.HIDE_TREE_PANEL_WHEN_WIDTH_LESS_THAN) {
appController.getMainPanel().collapseTreePanel();
GWT.log("Collapses tree panel");
}
}
// private void showGuidedTour() {

@ -136,7 +136,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
north.add(this.searchAndFilterContainer);
north.setScrollMode(Scroll.AUTOY);
west.add(this.expPanel);
north.addListener(Events.Resize, new Listener<BoxComponentEvent>(){
@Override
@ -215,4 +215,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
public void updateDnDParentId(String parentId){
dnd.setParameters(parentId, UPLOAD_TYPE.File);
}
public void collapseTreePanel() {
west.collapse();
}
}

@ -66,7 +66,7 @@ public class GxtToolBarItemFunctionality {
private ToolBar toolBar = new ToolBar();
private Button btnPreview;
private ToggleButton btnGridView;
// private Button btnGetInfo;
// private Button btnGetInfo;
private Button btnGetSharedLink;
private Button btnPublicLink;
private Button btnFolderLink;
@ -98,13 +98,13 @@ public class GxtToolBarItemFunctionality {
*/
private void initToolBar() {
btnGridView = new ToggleButton(ConstantsPortlet.CATEGORIZE, Resources.getIconGridView());
btnGridView.setToolTip("Categorize");
btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.toggle(true);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGridView);
btnGridView = new ToggleButton(ConstantsPortlet.CATEGORIZE, Resources.getIconGridView());
btnGridView.setToolTip("Categorize");
btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.toggle(true);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGridView);
toolBar.add(new SeparatorToolItem());
@ -123,6 +123,14 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnUploadFile);
//DOWNLOAD
btnDownloadFile = new Button(ConstantsPortlet.DOWNLOADITEM,Resources.getIconDownload());
btnDownloadFile.setScale(ButtonScale.SMALL);
btnDownloadFile.setIconAlign(IconAlign.TOP);
btnDownloadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnDownloadFile);
btnRefreshFolder = new Button(ConstantsPortlet.REFRESH, Resources.getIconRefresh());
btnRefreshFolder.setScale(ButtonScale.SMALL);
btnRefreshFolder.setIconAlign(IconAlign.TOP);
@ -131,13 +139,13 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnRefreshFolder);
toolBar.add(new SeparatorToolItem());
// btnGetInfo = new Button("Info", Resources.getIconInfo());
// btnGetInfo.setScale(ButtonScale.SMALL);
// btnGetInfo.setIconAlign(IconAlign.TOP);
// btnGetInfo.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnGetInfo);
// toolBar.add(new SeparatorToolItem());
// btnGetInfo = new Button("Info", Resources.getIconInfo());
// btnGetInfo.setScale(ButtonScale.SMALL);
// btnGetInfo.setIconAlign(IconAlign.TOP);
// btnGetInfo.setArrowAlign(ButtonArrowAlign.BOTTOM);
//
// toolBar.add(btnGetInfo);
// toolBar.add(new SeparatorToolItem());
btnRemoveItem = new Button(ConstantsPortlet.DELETEITEM,
Resources.getIconDeleteItem());
@ -146,8 +154,8 @@ public class GxtToolBarItemFunctionality {
btnRemoveItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnRemoveItem);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnRenameItem = new Button(ConstantsPortlet.RENAMEITEM, Resources.getIconRenameItem());
btnRenameItem.setScale(ButtonScale.SMALL);
@ -167,7 +175,7 @@ public class GxtToolBarItemFunctionality {
btnCutItem = new Button("Cut", Resources.getIconCut());
btnCutItem.setScale(ButtonScale.SMALL);
btnCutItem.setIconAlign(IconAlign.TOP);
// toolBar.add(btnCutItem);
// toolBar.add(btnCutItem);
//PASTE
btnPasteItem = new Button("Paste", Resources.getIconPaste());
@ -177,14 +185,6 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnPasteItem);
btnDownloadFile = new Button(ConstantsPortlet.DOWNLOADITEM,Resources.getIconDownload());
btnDownloadFile.setScale(ButtonScale.SMALL);
btnDownloadFile.setIconAlign(IconAlign.TOP);
btnDownloadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnDownloadFile);
btnPreview = new Button(ConstantsPortlet.PREVIEW ,Resources.getIconPreview());
btnPreview.setScale(ButtonScale.SMALL);
btnPreview.setIconAlign(IconAlign.TOP);
@ -198,7 +198,7 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnOpen);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem());
btnGetSharedLink = new Button("Get Link", Resources.getIconShareLink());
@ -214,7 +214,7 @@ public class GxtToolBarItemFunctionality {
btnPublicLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnPublicLink);
toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem());
btnFolderLink = new Button("Folder Link", Resources.getIconFolderPublic());
@ -223,18 +223,18 @@ public class GxtToolBarItemFunctionality {
btnFolderLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnFolderLink);
toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem());
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
// toolBar.add(btnAccessFromDesktop);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(btnAccessFromDesktop);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE, Resources.getIconArchiveUpload());
btnUploadArchive.setScale(ButtonScale.SMALL);
@ -242,8 +242,8 @@ public class GxtToolBarItemFunctionality {
btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnUploadArchive);
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
// toolBar.add(new SeparatorToolItem());
btnSetPermission= new Button(ConstantsPortlet.CHANGEPERMISSION,Resources.getIconWriteAll());
btnSetPermission.setScale(ButtonScale.SMALL);
@ -253,7 +253,7 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnSetPermission);
//TODO OLD CODE
//TODO OLD CODE
toggleGroup = new ToggleButton();
toggleGroup.setIcon(Resources.getIconToggleGroup());
toggleGroup.setToggleGroup("viewgrid");
@ -269,7 +269,7 @@ public class GxtToolBarItemFunctionality {
switchView(ViewSwitchTypeInResult.Group);
// toolBar.add(new FillToolItem());
// toolBar.add(new FillToolItem());
this.activeButtonsOnSelectForOperation(null, false);
}
@ -354,12 +354,12 @@ public class GxtToolBarItemFunctionality {
btnPasteItem.setEnabled(true);
}
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
}
});
@ -374,12 +374,12 @@ public class GxtToolBarItemFunctionality {
btnPasteItem.setEnabled(true);
}
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
}
});
@ -447,17 +447,17 @@ public class GxtToolBarItemFunctionality {
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new GetInfoEvent(fileGridModel));
//
// }
// });
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
//
// @Override
// public void componentSelected(ButtonEvent ce) {
//
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// AppController.getEventBus().fireEvent(new GetInfoEvent(fileGridModel));
//
// }
// });
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
@ -510,8 +510,8 @@ public class GxtToolBarItemFunctionality {
if(fileGridModel!=null && fileGridModel.isVreFolder()){
AppController.getEventBus().fireEvent(new VREChangePermissionsEvent(fileGridModel));
// DialogPermission dialog = new DialogPermission(fileGridModel);
// dialog.show();
// DialogPermission dialog = new DialogPermission(fileGridModel);
// dialog.show();
}
}
@ -550,19 +550,19 @@ public class GxtToolBarItemFunctionality {
if(fileGridModel!=null){
if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel));
// else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT) || fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE))
// AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
// else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT) || fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE))
// AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.EXTERNAL_URL)){
AppController.getEventBus().fireEvent(new ShowUrlEvent(fileGridModel));
}else
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW,fileGridModel.isDirectory() || fileGridModel.isVreFolder(), null));
}
}
}
});
btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
@ -677,7 +677,7 @@ public class GxtToolBarItemFunctionality {
switch(target.getGXTFolderItemType()){
case EXTERNAL_IMAGE:
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
this.btnPreview.enable();
this.btnPublicLink.enable();
break;
@ -688,10 +688,10 @@ public class GxtToolBarItemFunctionality {
this.btnPublicLink.enable();
break;
case EXTERNAL_URL:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case REPORT_TEMPLATE:
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
break;
case REPORT:
break;
@ -707,7 +707,7 @@ public class GxtToolBarItemFunctionality {
case DOCUMENT:
break;
case URL_DOCUMENT:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break;
case METADATA:
break;
@ -803,15 +803,15 @@ public class GxtToolBarItemFunctionality {
*/
public void activeAllButtonWithoutGroupView(boolean active){
btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active);
btnGetSharedLink.setEnabled(active);
// btnGetInfo.setEnabled(active);
btnDownloadFile.setEnabled(active);
btnPreview.setEnabled(active);
btnOpen.setEnabled(active);
btnPublicLink.setEnabled(active);
btnFolderLink.setEnabled(active);
btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active);
btnGetSharedLink.setEnabled(active);
// btnGetInfo.setEnabled(active);
btnDownloadFile.setEnabled(active);
btnPreview.setEnabled(active);
btnOpen.setEnabled(active);
btnPublicLink.setEnabled(active);
btnFolderLink.setEnabled(active);
}
/**

@ -0,0 +1,12 @@
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Print only messages of level TRACE or above in the package org.gcube
log4j.logger.org.gcube=TRACE
log4j.logger.org.gcube.application.framework.core.session=INFO
log4j.logger.org.gcube.common.scope.impl.DefaultScopeProvider=ERROR
log4j.logger.com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor=ERROR
Loading…
Cancel
Save