Updated pom version at 6.14.0

Added "Get Folder Link" facility

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@131336 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-09-14 10:20:44 +00:00
parent d100558011
commit 6e50d631b2
9 changed files with 389 additions and 159 deletions

View File

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

View File

@ -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="/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/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.14.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-tree-widget-TRUNK/workspace-tree-widget-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/> <property name="context-root" value="workspace"/>

24
pom.xml
View File

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId> <artifactId>workspace</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>6.13.0-SNAPSHOT</version> <version>6.14.0-SNAPSHOT</version>
<name>gCube Workspace Portlet</name> <name>gCube Workspace Portlet</name>
<description> <description>
gCube Workspace Portlet is a web-gui to manage the gCube workspace a collaborative area where users can exchange and organize information objects (workspace items) according to their specific needs. gCube Workspace Portlet is a web-gui to manage the gCube workspace a collaborative area where users can exchange and organize information objects (workspace items) according to their specific needs.
@ -143,16 +143,29 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- HOME LIBRARY --> <!-- HOME LIBRARY -->
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>home-library-model</artifactId> <artifactId>home-library-model</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.5.0-SNAPSHOT,3.5.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>asm-debug-all</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId> <artifactId>home-library</artifactId>
<version>[2.5.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -161,12 +174,7 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>com.liferay.portal</groupId> <groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId> <artifactId>portal-service</artifactId>

View File

@ -34,6 +34,7 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent; import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler; import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent; import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent; import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler; import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler;
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent; import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
@ -86,6 +87,8 @@ import org.gcube.portlets.user.workspace.client.event.VREChangePermissionsEventH
import org.gcube.portlets.user.workspace.client.event.VRESettingPermissionEvent; import org.gcube.portlets.user.workspace.client.event.VRESettingPermissionEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent; import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEventHandler; import org.gcube.portlets.user.workspace.client.event.WebDavUrlEventHandler;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEventHandler;
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum; import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum; import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
import org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface; import org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface;
@ -134,11 +137,12 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.HasWidgets;
/** /**
* The Class AppController. * The Class AppController.
* *
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Dec 14, 2015 * Sep 13, 2016
*/ */
public class AppController implements SubscriberInterface { public class AppController implements SubscriberInterface {
private final static HandlerManager eventBus = new HandlerManager(null); private final static HandlerManager eventBus = new HandlerManager(null);
@ -211,6 +215,16 @@ public class AppController implements SubscriberInterface {
} }
}); });
eventBus.addHandler(WsGetFolderLinkEvent.TYPE, new WsGetFolderLinkEventHandler() {
@Override
public void onGetFolderLink(WsGetFolderLinkEvent getFolderLinkEvent) {
AppControllerExplorer.getEventBus().fireEvent(new GetFolderLinkEvent(getFolderLinkEvent.getSourceFile()));
}
});
eventBus.addHandler(UpdateWorkspaceSizeEvent.TYPE, new UpdateWorkspaceSizeEventHandler() { eventBus.addHandler(UpdateWorkspaceSizeEvent.TYPE, new UpdateWorkspaceSizeEventHandler() {
@Override @Override

View File

@ -0,0 +1,54 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class WsGetFolderLinkEvent.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Sep 13, 2016
*/
public class WsGetFolderLinkEvent extends GwtEvent<WsGetFolderLinkEventHandler> {
public static Type<WsGetFolderLinkEventHandler> TYPE = new Type<WsGetFolderLinkEventHandler>();
private FileModel targetFile = null;
/**
* Instantiates a new gets the folder link event.
*
* @param target the target
*/
public WsGetFolderLinkEvent(FileModel target) {
this.targetFile = target;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<WsGetFolderLinkEventHandler> getAssociatedType() {
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
*/
@Override
protected void dispatch(WsGetFolderLinkEventHandler handler) {
handler.onGetFolderLink(this);
}
/**
* Gets the source file.
*
* @return the source file
*/
public FileModel getSourceFile() {
return targetFile;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface GetFolderLinkEventHandler.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Sep 13, 2016
*/
public interface WsGetFolderLinkEventHandler extends EventHandler {
/**
* On get folder link.
*
* @param getFolderLinkEvent the get folder link event
*/
void onGetFolderLink(WsGetFolderLinkEvent getFolderLinkEvent);
}

View File

@ -69,6 +69,10 @@ public class WorkspaceFeaturesView extends Composite {
private Popover overPlk = new Popover(); private Popover overPlk = new Popover();
@UiField
Label flk; //PUBLIC LINK
private Popover overFolderlk = new Popover();
@UiField @UiField
FlowPanel fp1; FlowPanel fp1;
@ -129,8 +133,10 @@ public class WorkspaceFeaturesView extends Composite {
ck_features_show_again.addStyleName("margin-right-10"); ck_features_show_again.addStyleName("margin-right-10");
shf.addStyleName("margin-right-10"); shf.addStyleName("margin-right-10");
upl.addStyleName("margin-right-10"); upl.addStyleName("margin-right-10");
flk.addStyleName("margin-right-10");
plk.addStyleName("margin-right-10"); plk.addStyleName("margin-right-10");
initPopupShareFeature(); initPopupShareFeature();
initPopupFlkFeature();
initPopupUploadFeature(); initPopupUploadFeature();
initPopupPlkFeature(); initPopupPlkFeature();
@ -159,6 +165,23 @@ public class WorkspaceFeaturesView extends Composite {
}); });
} }
/**
*
*/
private void initPopupFlkFeature() {
overFolderlk.setAnimation(false);
overFolderlk.setWidget(flk);
overFolderlk.setHeading("Workspace Folder Link");
String icon = "<span style=\"margin-right:5px\">"+Resources.getIconFolderLink().getSafeHtml().asString()+"</span>";
overFolderlk.setText(icon+"The owner or administrator can use the Folder Link in order to allow 'guest' users to view contents of a folder (and its sub-folders)" +
"The 'guest' user can only access in read-only mode and download files of the folder (and its subfolders). You can send the Folder Link to anyone by pasting it into Workspace Message, your emails, instant messages, etc.");
overFolderlk.setHtml(true);
overFolderlk.setPlacement(Placement.BOTTOM);
overFolderlk.setTrigger(Trigger.HOVER);
overFolderlk.reconfigure();
}
/** /**
* Inits the popup share feature. * Inits the popup share feature.
*/ */

View File

@ -29,6 +29,7 @@
verticalAlignment="middle"> verticalAlignment="middle">
<b:Label ui:field="shf" text="Share"></b:Label> <b:Label ui:field="shf" text="Share"></b:Label>
<b:Label ui:field="flk" text="Folder Link"></b:Label>
<b:Label ui:field="plk" text="Public Link"></b:Label> <b:Label ui:field="plk" text="Public Link"></b:Label>
<b:Label ui:field="upl" text="Upload"></b:Label> <b:Label ui:field="upl" text="Upload"></b:Label>
<!-- <b:Label ui:field="upa" text="Upload Archive"></b:Label> --> <!-- <b:Label ui:field="upa" text="Upload Archive"></b:Label> -->

View File

@ -13,6 +13,7 @@ import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelected
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent; import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType; import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent; import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent; import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent; import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GridRefreshEvent; import org.gcube.portlets.user.workspace.client.event.GridRefreshEvent;
@ -39,10 +40,12 @@ import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ToggleButton; import com.extjs.gxt.ui.client.widget.button.ToggleButton;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem; import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.shared.GWT;
/** /**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * The Class GxtToolBarItemFunctionality.
* *
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
*/ */
public class GxtToolBarItemFunctionality { public class GxtToolBarItemFunctionality {
@ -66,40 +69,52 @@ public class GxtToolBarItemFunctionality {
// private Button btnGetInfo; // private Button btnGetInfo;
private Button btnGetSharedLink; private Button btnGetSharedLink;
private Button btnPublicLink; private Button btnPublicLink;
private Button btnFolderLink;
private Button btnCopyItem; private Button btnCopyItem;
private Button btnPasteItem; private Button btnPasteItem;
private Button btnCutItem; private Button btnCutItem;
private Button btnSetPermission; private Button btnSetPermission;
/**
* Instantiates a new gxt tool bar item functionality.
*/
public GxtToolBarItemFunctionality() { public GxtToolBarItemFunctionality() {
initToolBar(); initToolBar();
addSelectionListenersOnToolBar(); addSelectionListenersOnToolBar();
} }
/**
* Instantiates a new gxt tool bar item functionality.
*
* @param gridFilterGroupContainer the grid filter group container
*/
public GxtToolBarItemFunctionality(GxtGridFilterGroupPanel gridFilterGroupContainer) { public GxtToolBarItemFunctionality(GxtGridFilterGroupPanel gridFilterGroupContainer) {
this(); this();
this.gridGroupViewContainer = gridFilterGroupContainer; this.gridGroupViewContainer = gridFilterGroupContainer;
} }
/**
* Inits the tool bar.
*/
private void initToolBar() { private void initToolBar() {
btnGridView = new ToggleButton(ConstantsPortlet.CATEGORIZE, Resources.getIconGridView()); btnGridView = new ToggleButton(ConstantsPortlet.CATEGORIZE, Resources.getIconGridView());
btnGridView.setToolTip("Categorize"); btnGridView.setToolTip("Categorize");
btnGridView.setScale(ButtonScale.SMALL); btnGridView.setScale(ButtonScale.SMALL);
btnGridView.setIconAlign(IconAlign.TOP); btnGridView.setIconAlign(IconAlign.TOP);
btnGridView.toggle(true); btnGridView.toggle(true);
btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM); btnGridView.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGridView); toolBar.add(btnGridView);
toolBar.add(new SeparatorToolItem()); toolBar.add(new SeparatorToolItem());
btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER,Resources.getIconAddFolder()); btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER,Resources.getIconAddFolder());
btnAddFolder.setScale(ButtonScale.SMALL); btnAddFolder.setScale(ButtonScale.SMALL);
btnAddFolder.setIconAlign(IconAlign.TOP); btnAddFolder.setIconAlign(IconAlign.TOP);
btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM); btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnAddFolder); toolBar.add(btnAddFolder);
btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE, btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE,
Resources.getIconFileUpload()); Resources.getIconFileUpload());
btnUploadFile.setScale(ButtonScale.SMALL); btnUploadFile.setScale(ButtonScale.SMALL);
@ -107,7 +122,7 @@ public class GxtToolBarItemFunctionality {
btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM); btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnUploadFile); toolBar.add(btnUploadFile);
btnRefreshFolder = new Button(ConstantsPortlet.REFRESH, Resources.getIconRefresh()); btnRefreshFolder = new Button(ConstantsPortlet.REFRESH, Resources.getIconRefresh());
btnRefreshFolder.setScale(ButtonScale.SMALL); btnRefreshFolder.setScale(ButtonScale.SMALL);
btnRefreshFolder.setIconAlign(IconAlign.TOP); btnRefreshFolder.setIconAlign(IconAlign.TOP);
@ -139,15 +154,15 @@ public class GxtToolBarItemFunctionality {
btnRenameItem.setIconAlign(IconAlign.TOP); btnRenameItem.setIconAlign(IconAlign.TOP);
btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM); btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnRenameItem); toolBar.add(btnRenameItem);
//COPY //COPY
btnCopyItem = new Button("Copy", Resources.getIconCopy()); btnCopyItem = new Button("Copy", Resources.getIconCopy());
btnCopyItem.setScale(ButtonScale.SMALL); btnCopyItem.setScale(ButtonScale.SMALL);
btnCopyItem.setIconAlign(IconAlign.TOP); btnCopyItem.setIconAlign(IconAlign.TOP);
toolBar.add(btnCopyItem); toolBar.add(btnCopyItem);
//CUT //CUT
btnCutItem = new Button("Cut", Resources.getIconCut()); btnCutItem = new Button("Cut", Resources.getIconCut());
btnCutItem.setScale(ButtonScale.SMALL); btnCutItem.setScale(ButtonScale.SMALL);
@ -159,7 +174,7 @@ public class GxtToolBarItemFunctionality {
btnPasteItem.setScale(ButtonScale.SMALL); btnPasteItem.setScale(ButtonScale.SMALL);
btnPasteItem.setIconAlign(IconAlign.TOP); btnPasteItem.setIconAlign(IconAlign.TOP);
btnPasteItem.setEnabled(false); //BY DEFAULT IS DISABLED btnPasteItem.setEnabled(false); //BY DEFAULT IS DISABLED
toolBar.add(btnPasteItem); toolBar.add(btnPasteItem);
@ -175,24 +190,24 @@ public class GxtToolBarItemFunctionality {
btnPreview.setIconAlign(IconAlign.TOP); btnPreview.setIconAlign(IconAlign.TOP);
btnPreview.setArrowAlign(ButtonArrowAlign.BOTTOM); btnPreview.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnPreview); toolBar.add(btnPreview);
btnOpen = new Button(ConstantsPortlet.OPEN ,Resources.getIconShow()); btnOpen = new Button(ConstantsPortlet.OPEN ,Resources.getIconShow());
btnOpen.setScale(ButtonScale.SMALL); btnOpen.setScale(ButtonScale.SMALL);
btnOpen.setIconAlign(IconAlign.TOP); btnOpen.setIconAlign(IconAlign.TOP);
btnOpen.setArrowAlign(ButtonArrowAlign.BOTTOM); btnOpen.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnOpen); toolBar.add(btnOpen);
// toolBar.add(new SeparatorToolItem()); // toolBar.add(new SeparatorToolItem());
toolBar.add(new SeparatorToolItem()); toolBar.add(new SeparatorToolItem());
btnGetSharedLink = new Button("Get Link", Resources.getIconShareLink()); btnGetSharedLink = new Button("Get Link", Resources.getIconShareLink());
btnGetSharedLink.setScale(ButtonScale.SMALL); btnGetSharedLink.setScale(ButtonScale.SMALL);
btnGetSharedLink.setIconAlign(IconAlign.TOP); btnGetSharedLink.setIconAlign(IconAlign.TOP);
btnGetSharedLink.setArrowAlign(ButtonArrowAlign.BOTTOM); btnGetSharedLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnGetSharedLink); toolBar.add(btnGetSharedLink);
btnPublicLink = new Button("Public Link", Resources.getIconPublicLink()); btnPublicLink = new Button("Public Link", Resources.getIconPublicLink());
btnPublicLink.setScale(ButtonScale.SMALL); btnPublicLink.setScale(ButtonScale.SMALL);
btnPublicLink.setIconAlign(IconAlign.TOP); btnPublicLink.setIconAlign(IconAlign.TOP);
@ -200,20 +215,28 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnPublicLink); toolBar.add(btnPublicLink);
toolBar.add(new SeparatorToolItem()); toolBar.add(new SeparatorToolItem());
btnFolderLink = new Button("Folder Link", Resources.getIconFolderLink());
btnFolderLink.setScale(ButtonScale.SMALL);
btnFolderLink.setIconAlign(IconAlign.TOP);
btnFolderLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
toolBar.add(btnFolderLink);
toolBar.add(new SeparatorToolItem());
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav()); btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
btnAccessFromDesktop.setScale(ButtonScale.SMALL); btnAccessFromDesktop.setScale(ButtonScale.SMALL);
btnAccessFromDesktop.setIconAlign(IconAlign.TOP); btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM); btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
// toolBar.add(btnAccessFromDesktop); // toolBar.add(btnAccessFromDesktop);
// toolBar.add(new SeparatorToolItem()); // 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, btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE, Resources.getIconArchiveUpload());
Resources.getIconArchiveUpload());
btnUploadArchive.setScale(ButtonScale.SMALL); btnUploadArchive.setScale(ButtonScale.SMALL);
btnUploadArchive.setIconAlign(IconAlign.TOP); btnUploadArchive.setIconAlign(IconAlign.TOP);
btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM); btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
@ -221,15 +244,15 @@ public class GxtToolBarItemFunctionality {
toolBar.add(btnUploadArchive); 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= new Button(ConstantsPortlet.CHANGEPERMISSION,Resources.getIconWriteAll());
btnSetPermission.setScale(ButtonScale.SMALL); btnSetPermission.setScale(ButtonScale.SMALL);
btnSetPermission.setIconAlign(IconAlign.TOP); btnSetPermission.setIconAlign(IconAlign.TOP);
btnSetPermission.setArrowAlign(ButtonArrowAlign.BOTTOM); btnSetPermission.setArrowAlign(ButtonArrowAlign.BOTTOM);
btnSetPermission.setToolTip("Change VRE Folder permissions"); btnSetPermission.setToolTip("Change VRE Folder permissions");
toolBar.add(btnSetPermission); toolBar.add(btnSetPermission);
//TODO OLD CODE //TODO OLD CODE
toggleGroup = new ToggleButton(); toggleGroup = new ToggleButton();
toggleGroup.setIcon(Resources.getIconToggleGroup()); toggleGroup.setIcon(Resources.getIconToggleGroup());
@ -250,29 +273,37 @@ public class GxtToolBarItemFunctionality {
this.activeButtonsOnSelectForOperation(null, false); this.activeButtonsOnSelectForOperation(null, false);
} }
/**
* Toggle grid view button.
*
* @param toogle the toogle
*/
public void toggleGridViewButton(boolean toogle){ public void toggleGridViewButton(boolean toogle){
btnGridView.toggle(toogle); btnGridView.toggle(toogle);
} }
/**
* Adds the selection listeners on tool bar.
*/
private void addSelectionListenersOnToolBar() { private void addSelectionListenersOnToolBar() {
btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() { btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new AddFolderEvent(gridGroupViewContainer.getCurrentFolderView(), null)); AppController.getEventBus().fireEvent(new AddFolderEvent(gridGroupViewContainer.getCurrentFolderView(), null));
} }
}); });
btnGridView.addSelectionListener(new SelectionListener<ButtonEvent>() { btnGridView.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new ActiveGroupingView(btnGridView.isPressed())); AppController.getEventBus().fireEvent(new ActiveGroupingView(btnGridView.isPressed()));
} }
}); });
@ -284,13 +315,13 @@ public class GxtToolBarItemFunctionality {
List<FileGridModel> listTarget = gridGroupViewContainer.getSelectedItems(); List<FileGridModel> listTarget = gridGroupViewContainer.getSelectedItems();
if(listTarget!=null){ if(listTarget!=null){
if(listTarget.size()>1){ //IS MULTI if(listTarget.size()>1){ //IS MULTI
AppController.getEventBus().fireEvent(new DeleteItemEvent(listTarget)); AppController.getEventBus().fireEvent(new DeleteItemEvent(listTarget));
}else{ }else{
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
AppController.getEventBus().fireEvent(new DeleteItemEvent(fileGridModel)); AppController.getEventBus().fireEvent(new DeleteItemEvent(fileGridModel));
} }
@ -298,7 +329,7 @@ public class GxtToolBarItemFunctionality {
} }
}); });
btnGetSharedLink.addSelectionListener(new SelectionListener<ButtonEvent>() { btnGetSharedLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@ -311,74 +342,74 @@ public class GxtToolBarItemFunctionality {
} }
}); });
btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() { btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems(); List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems();
if(listTarget!=null && listTarget.size()>0){ if(listTarget!=null && listTarget.size()>0){
CutCopyAndPaste.copy(listTarget, OperationType.COPY); CutCopyAndPaste.copy(listTarget, OperationType.COPY);
btnPasteItem.setEnabled(true); btnPasteItem.setEnabled(true);
} }
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); // final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
// //
// if(fileGridModel.getIdentifier()!=null){ // if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier()); // CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true); // btnPasteItem.setEnabled(true);
// } // }
} }
}); });
btnCutItem.addSelectionListener(new SelectionListener<ButtonEvent>() { btnCutItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems(); List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems();
if(listTarget!=null && listTarget.size()>0){ if(listTarget!=null && listTarget.size()>0){
CutCopyAndPaste.copy(listTarget, OperationType.CUT); CutCopyAndPaste.copy(listTarget, OperationType.CUT);
btnPasteItem.setEnabled(true); btnPasteItem.setEnabled(true);
} }
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); // final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
// //
// if(fileGridModel.getIdentifier()!=null){ // if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier()); // CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true); // btnPasteItem.setEnabled(true);
// } // }
} }
}); });
btnPasteItem.addSelectionListener(new SelectionListener<ButtonEvent>() { btnPasteItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
FileModel parentTarget = getDirectoryOrParent(fileGridModel); FileModel parentTarget = getDirectoryOrParent(fileGridModel);
String parentId = null; String parentId = null;
if(parentTarget!=null) if(parentTarget!=null)
parentId=parentTarget.getIdentifier(); parentId=parentTarget.getIdentifier();
PasteItemEvent event = new PasteItemEvent(CutCopyAndPaste.getCopiedIdsFilesModel(), parentId, CutCopyAndPaste.getOperationType()); PasteItemEvent event = new PasteItemEvent(CutCopyAndPaste.getCopiedIdsFilesModel(), parentId, CutCopyAndPaste.getOperationType());
if(event.getOperationType().equals(OperationType.CUT)) if(event.getOperationType().equals(OperationType.CUT))
event.setFolderSourceId(null); event.setFolderSourceId(null);
AppController.getEventBus().fireEvent(event); AppController.getEventBus().fireEvent(event);
CutCopyAndPaste.setCopiedIdsFileModels(null); CutCopyAndPaste.setCopiedIdsFileModels(null);
CutCopyAndPaste.setOperationType(null); CutCopyAndPaste.setOperationType(null);
btnPasteItem.setEnabled(false); btnPasteItem.setEnabled(false);
} }
}); });
btnRefreshFolder.addSelectionListener(new SelectionListener<ButtonEvent>() { btnRefreshFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
@ -388,7 +419,7 @@ public class GxtToolBarItemFunctionality {
} }
}); });
btnPublicLink.addSelectionListener(new SelectionListener<ButtonEvent>() { btnPublicLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
@ -400,8 +431,22 @@ public class GxtToolBarItemFunctionality {
} }
}); });
btnFolderLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
GWT.log("file selected: "+fileGridModel);
if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new WsGetFolderLinkEvent(fileGridModel));
}
});
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() { // btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
// //
// @Override // @Override
@ -413,7 +458,7 @@ public class GxtToolBarItemFunctionality {
// //
// } // }
// }); // });
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() { btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
@ -431,9 +476,9 @@ public class GxtToolBarItemFunctionality {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null) if(fileGridModel!=null)
AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.File)); AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.File));
else else
@ -445,30 +490,30 @@ public class GxtToolBarItemFunctionality {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null) if(fileGridModel!=null)
AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.Archive)); AppController.getEventBus().fireEvent(new FileUploadEvent(fileGridModel.getParentFileModel(), WS_UPLOAD_TYPE.Archive));
else else
AppController.getEventBus().fireEvent(new FileUploadEvent(null, WS_UPLOAD_TYPE.Archive)); AppController.getEventBus().fireEvent(new FileUploadEvent(null, WS_UPLOAD_TYPE.Archive));
} }
}); });
btnSetPermission.addSelectionListener(new SelectionListener<ButtonEvent>() { btnSetPermission.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null && fileGridModel.isVreFolder()){ if(fileGridModel!=null && fileGridModel.isVreFolder()){
AppController.getEventBus().fireEvent(new VREChangePermissionsEvent(fileGridModel)); AppController.getEventBus().fireEvent(new VREChangePermissionsEvent(fileGridModel));
// DialogPermission dialog = new DialogPermission(fileGridModel); // DialogPermission dialog = new DialogPermission(fileGridModel);
// dialog.show(); // dialog.show();
} }
} }
}); });
@ -483,7 +528,7 @@ public class GxtToolBarItemFunctionality {
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD)); AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD));
} }
}); });
btnPreview.addSelectionListener(new SelectionListener<ButtonEvent>() { btnPreview.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
@ -495,14 +540,14 @@ public class GxtToolBarItemFunctionality {
} }
}); });
btnOpen.addSelectionListener(new SelectionListener<ButtonEvent>() { btnOpen.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
if(fileGridModel!=null){ if(fileGridModel!=null){
if(fileGridModel.isDirectory()) if(fileGridModel.isDirectory())
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel)); AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel));
@ -510,20 +555,20 @@ public class GxtToolBarItemFunctionality {
AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel)); AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
else else
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW)); AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW));
} }
} }
}); });
btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() { btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new WebDavUrlEvent(null)); AppController.getEventBus().fireEvent(new WebDavUrlEvent(null));
} }
}); });
toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>() { toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
@ -557,6 +602,11 @@ public class GxtToolBarItemFunctionality {
}); });
} }
/**
* Switch view.
*
* @param type the type
*/
private void switchView(ViewSwitchTypeInResult type) { private void switchView(ViewSwitchTypeInResult type) {
// if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) { // if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) {
@ -579,11 +629,12 @@ public class GxtToolBarItemFunctionality {
// } // }
} }
/** /**
* The method return input file model if is directory otherwise parent of file model * The method return input file model if is directory otherwise parent of file model.
* @param fileModel *
* @return * @param fileModel the file model
* @return the directory or parent
*/ */
private FileModel getDirectoryOrParent(FileGridModel fileModel){ private FileModel getDirectoryOrParent(FileGridModel fileModel){
@ -597,26 +648,33 @@ public class GxtToolBarItemFunctionality {
return null; return null;
} }
/**
* Active buttons on select for operation.
*
* @param target the target
* @param active the active
*/
public void activeButtonsOnSelectForOperation(FileModel target, boolean active) { public void activeButtonsOnSelectForOperation(FileModel target, boolean active) {
this.btnPreview.disable(); this.btnPreview.disable();
this.btnPublicLink.disable(); this.btnPublicLink.disable();
this.btnFolderLink.disable();
this.btnGetSharedLink.disable(); this.btnGetSharedLink.disable();
this.btnOpen.enable(); this.btnOpen.enable();
this.btnSetPermission.disable(); this.btnSetPermission.disable();
//ADDED 07/03/2014 //ADDED 07/03/2014
this.btnAddFolder.enable(); this.btnAddFolder.enable();
this.btnUploadArchive.enable(); this.btnUploadArchive.enable();
this.btnUploadFile.enable(); this.btnUploadFile.enable();
if(target!=null){ if(target!=null){
if(active & target.getGXTFolderItemType()!=null){ if(active & target.getGXTFolderItemType()!=null){
switch(target.getGXTFolderItemType()){ switch(target.getGXTFolderItemType()){
case EXTERNAL_IMAGE: case EXTERNAL_IMAGE:
// contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true); // contextMenu.getItemByItemId(ConstantsExplorer.PRW).setVisible(true);
this.btnPreview.enable(); this.btnPreview.enable();
this.btnPublicLink.enable(); this.btnPublicLink.enable();
@ -624,78 +682,90 @@ public class GxtToolBarItemFunctionality {
case EXTERNAL_FILE: case EXTERNAL_FILE:
this.btnPublicLink.enable(); this.btnPublicLink.enable();
break; break;
case EXTERNAL_PDF_FILE: case EXTERNAL_PDF_FILE:
this.btnPublicLink.enable(); this.btnPublicLink.enable();
break; break;
case EXTERNAL_URL: case EXTERNAL_URL:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true); // contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break; break;
case REPORT_TEMPLATE: case REPORT_TEMPLATE:
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true); // contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
break; break;
case REPORT: case REPORT:
break; break;
case QUERY: case QUERY:
break; break;
case TIME_SERIES: case TIME_SERIES:
break; break;
case PDF_DOCUMENT: case PDF_DOCUMENT:
break; break;
case IMAGE_DOCUMENT: case IMAGE_DOCUMENT:
this.btnPreview.enable(); this.btnPreview.enable();
break; break;
case DOCUMENT: case DOCUMENT:
break; break;
case URL_DOCUMENT: case URL_DOCUMENT:
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true); // contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
break; break;
case METADATA: case METADATA:
break; break;
case WORKFLOW_REPORT: case WORKFLOW_REPORT:
break; break;
case WORKFLOW_TEMPLATE: case WORKFLOW_TEMPLATE:
break; break;
default: default:
} }
} }
//HANDLER SharedLink //HANDLER SharedLink
if(target.isShared()) if(target.isShared())
activeButtonForSharing(active); activeButtonForSharing(active);
else else
activeButtonForSharing(false); activeButtonForSharing(false);
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING //IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){ if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
this.btnPasteItem.enable(); this.btnPasteItem.enable();
} }
} }
//TARGET (SELECTED ITEM) CAN BE NULL, HIS PARENT IS NOT NULL ACTIVING BUTTONS //TARGET (SELECTED ITEM) CAN BE NULL, HIS PARENT IS NOT NULL ACTIVING BUTTONS
activeButtons(active); activeButtons(active);
//HANDLING VRE FOLDER AND SPECIAL FOLDER GRID ITEM SELECTION
if(target!=null && (target.isVreFolder() || target.isSpecialFolder())){
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
if(target.isVreFolder()) //IS VRE -> ENABLING SET PERMISSION if(target!=null){
this.btnSetPermission.enable();
//HANDLING VRE FOLDER AND SPECIAL FOLDER GRID ITEM SELECTION
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE if(target.isVreFolder() || target.isSpecialFolder()){
disableButtonSpecialFolderSelected();
this.btnRemoveItem.disable();
this.btnRenameItem.disable();
if(target.isVreFolder()) //IS VRE -> ENABLING SET PERMISSION
this.btnSetPermission.enable();
if(target.isSpecialFolder()){ //IS SPECIAL FOLDER -> DISABLING COPY AND PASTE
disableButtonSpecialFolderSelected();
}
this.btnRefreshFolder.enable();
}else if(target.isDirectory()){
this.btnFolderLink.enable();
this.btnRefreshFolder.enable();
} }
this.btnRefreshFolder.enable();
} }
} }
/**
* Active buttons.
*
* @param active the active
*/
private void activeButtons(boolean active){ private void activeButtons(boolean active){
if (!active) { if (!active) {
this.btnRemoveItem.disable(); this.btnRemoveItem.disable();
this.btnRenameItem.disable(); this.btnRenameItem.disable();
@ -703,12 +773,12 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.disable(); this.btnOpen.disable();
this.btnCopyItem.disable(); this.btnCopyItem.disable();
this.btnCutItem.disable(); this.btnCutItem.disable();
//ADDED 07/03/2104 //ADDED 07/03/2104
// this.btnAddFolder.disable(); // this.btnAddFolder.disable();
// this.btnUploadArchive.disable(); // this.btnUploadArchive.disable();
// this.btnUploadFile.disable(); // this.btnUploadFile.disable();
// this.btnGetInfo.disable(); // this.btnGetInfo.disable();
// this.btnGetSharedLink.disable(); // this.btnGetSharedLink.disable();
} else { } else {
@ -718,24 +788,34 @@ public class GxtToolBarItemFunctionality {
this.btnOpen.enable(); this.btnOpen.enable();
this.btnCopyItem.enable(); this.btnCopyItem.enable();
this.btnCutItem.enable(); this.btnCutItem.enable();
//ADDED 07/03/2104 //ADDED 07/03/2104
// this.btnAddFolder.enable(); // this.btnAddFolder.enable();
// this.btnUploadArchive.enable(); // this.btnUploadArchive.enable();
// this.btnUploadFile.enable(); // this.btnUploadFile.enable();
// this.btnGetInfo.enable(); // this.btnGetInfo.enable();
} }
} }
/**
* Active button for sharing.
*
* @param active the active
*/
public void activeButtonForSharing(boolean active){ public void activeButtonForSharing(boolean active){
this.btnGetSharedLink.setEnabled(active); this.btnGetSharedLink.setEnabled(active);
} }
/**
* Active all button without group view.
*
* @param active the active
*/
public void activeAllButtonWithoutGroupView(boolean active){ public void activeAllButtonWithoutGroupView(boolean active){
btnRemoveItem.setEnabled(active); btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active); btnRenameItem.setEnabled(active);
btnGetSharedLink.setEnabled(active); btnGetSharedLink.setEnabled(active);
@ -744,37 +824,59 @@ public class GxtToolBarItemFunctionality {
btnPreview.setEnabled(active); btnPreview.setEnabled(active);
btnOpen.setEnabled(active); btnOpen.setEnabled(active);
btnPublicLink.setEnabled(active); btnPublicLink.setEnabled(active);
btnFolderLink.setEnabled(active);
} }
/**
* Active button for multi selection.
*
* @param active the active
*/
public void activeButtonForMultiSelection(boolean active){ public void activeButtonForMultiSelection(boolean active){
this.btnRenameItem.setEnabled(!active); this.btnRenameItem.setEnabled(!active);
this.btnDownloadFile.setEnabled(!active); this.btnDownloadFile.setEnabled(!active);
this.btnOpen.setEnabled(!active); this.btnOpen.setEnabled(!active);
this.btnGetSharedLink.setEnabled(!active); this.btnGetSharedLink.setEnabled(!active);
this.btnPublicLink.setEnabled(!active); this.btnPublicLink.setEnabled(!active);
this.btnFolderLink.setEnabled(!active);
this.btnSetPermission.setEnabled(!active); this.btnSetPermission.setEnabled(!active);
//ONLY ENABLED //ONLY ENABLED
this.btnRemoveItem.setEnabled(active); this.btnRemoveItem.setEnabled(active);
this.btnCopyItem.setEnabled(active); this.btnCopyItem.setEnabled(active);
this.btnCutItem.setEnabled(active); this.btnCutItem.setEnabled(active);
} }
/**
* Gets the tool bar.
*
* @return the tool bar
*/
public ToolBar getToolBar() { public ToolBar getToolBar() {
return this.toolBar; return this.toolBar;
} }
/** /**
* @param b * Active buttons on search.
*
* @param b the b
*/ */
public void activeButtonsOnSearch(boolean b) { public void activeButtonsOnSearch(boolean b) {
btnRefreshFolder.setEnabled(!b); btnRefreshFolder.setEnabled(!b);
} }
/**
* Active paste button.
*
* @param b the b
*/
public void activePasteButton(boolean b){ public void activePasteButton(boolean b){
btnPasteItem.setEnabled(b); btnPasteItem.setEnabled(b);
} }
/**
* Disable button special folder selected.
*/
public void disableButtonSpecialFolderSelected(){ public void disableButtonSpecialFolderSelected(){
this.btnPasteItem.disable(); this.btnPasteItem.disable();
this.btnCopyItem.disable(); this.btnCopyItem.disable();
@ -786,15 +888,20 @@ public class GxtToolBarItemFunctionality {
this.btnRemoveItem.disable(); this.btnRemoveItem.disable();
this.btnRenameItem.disable(); this.btnRenameItem.disable();
} }
/**
* Enable button for active breadcrumb.
*
* @param parent the parent
*/
public void enableButtonForActiveBreadcrumb(FileModel parent){ public void enableButtonForActiveBreadcrumb(FileModel parent){
if(parent!=null){ if(parent!=null){
//IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING //IF TARGET IS NOT NULL AND AN ITEM IS COPIED, PASTE IS ENABLING
if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){ if(CutCopyAndPaste.getCopiedIdsFilesModel()!=null){
this.btnPasteItem.enable(); this.btnPasteItem.enable();
} }
this.btnCopyItem.enable(); this.btnCopyItem.enable();
this.btnAddFolder.enable(); this.btnAddFolder.enable();
this.btnUploadArchive.enable(); this.btnUploadArchive.enable();