Enhancement on file versioning #7006
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@142775 82a268e6-3cf1-43bd-a215-b396298e98cftask/19600
parent
5c46c8d997
commit
33c3c4fa22
@ -0,0 +1,162 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
import org.gcube.portlets.user.workspace.client.view.versioning.WindowVersioning;
|
||||
import org.gcube.portlets.user.workspace.shared.WorkspaceVersioningOperation;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
/**
|
||||
* The Class FileVersioningEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 20, 2017
|
||||
*/
|
||||
public class FileVersioningEvent extends GwtEvent<FileVersioningEventHandler> implements GuiEventInterface{
|
||||
|
||||
public static Type<FileVersioningEventHandler> TYPE = new Type<FileVersioningEventHandler>();
|
||||
private WorkspaceVersioningOperation workspaceVersioningOperation;
|
||||
private FileModel currentVersion;
|
||||
private FileModel olderVersion;
|
||||
private WindowVersioning winVersioning;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new file versioning event.
|
||||
*
|
||||
* @param workspaceVersioningOperation the workspace versioning operation
|
||||
* @param currentVersion the current version
|
||||
* @param olderVersion the older version
|
||||
* @param winVersioning the win versioning
|
||||
*/
|
||||
public FileVersioningEvent(WorkspaceVersioningOperation workspaceVersioningOperation, FileModel currentVersion, FileModel olderVersion, WindowVersioning winVersioning) {
|
||||
this.workspaceVersioningOperation = workspaceVersioningOperation;
|
||||
this.currentVersion = currentVersion;
|
||||
this.olderVersion = olderVersion;
|
||||
this.winVersioning = winVersioning;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the win versioning.
|
||||
*
|
||||
* @return the winVersioning
|
||||
*/
|
||||
public WindowVersioning getWinVersioning() {
|
||||
|
||||
return winVersioning;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current version.
|
||||
*
|
||||
* @return the currentVersion
|
||||
*/
|
||||
public FileModel getCurrentVersion() {
|
||||
|
||||
return currentVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the current version.
|
||||
*
|
||||
* @param currentVersion the currentVersion to set
|
||||
*/
|
||||
public void setCurrentVersion(FileModel currentVersion) {
|
||||
|
||||
this.currentVersion = currentVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the older version.
|
||||
*
|
||||
* @return the olderVersion
|
||||
*/
|
||||
public FileModel getOlderVersion() {
|
||||
|
||||
return olderVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the workspace versioning operation.
|
||||
*
|
||||
* @param workspaceVersioningOperation the workspaceVersioningOperation to set
|
||||
*/
|
||||
public void setWorkspaceVersioningOperation(
|
||||
WorkspaceVersioningOperation workspaceVersioningOperation) {
|
||||
|
||||
this.workspaceVersioningOperation = workspaceVersioningOperation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the older version.
|
||||
*
|
||||
* @param olderVersion the olderVersion to set
|
||||
*/
|
||||
public void setOlderVersion(FileModel olderVersion) {
|
||||
|
||||
this.olderVersion = olderVersion;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<FileVersioningEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(FileVersioningEventHandler handler) {
|
||||
handler.onFileVersioning(this);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface#getKey()
|
||||
*/
|
||||
@Override
|
||||
public EventsTypeEnum getKey() {
|
||||
return EventsTypeEnum.FILE_VERSIONING_HISTORY_EVENT;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the versioning operation.
|
||||
*
|
||||
* @param workspaceVersioningOperation the new versioning operation
|
||||
*/
|
||||
public void setVersioningOperation(WorkspaceVersioningOperation workspaceVersioningOperation) {
|
||||
this.workspaceVersioningOperation = workspaceVersioningOperation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the versioning operation.
|
||||
*
|
||||
* @return the versioning operation
|
||||
*/
|
||||
public WorkspaceVersioningOperation getVersioningOperation() {
|
||||
|
||||
return workspaceVersioningOperation;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
|
||||
/**
|
||||
* The Interface FileVersioningEventHandler.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 20, 2017
|
||||
*/
|
||||
public interface FileVersioningEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* On file versioning.
|
||||
*
|
||||
* @param fileVersioningEvent the file versioning event
|
||||
*/
|
||||
void onFileVersioning(FileVersioningEvent fileVersioningEvent);
|
||||
}
|
Loading…
Reference in New Issue