2521: Explore the possibility to port the StatMan interface onto Dataminer
https://support.d4science.org/issues/2521 Fixed Added Computations git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@128339 82a268e6-3cf1-43bd-a215-b396298e98cfmaster
parent
e43bac9129
commit
fe208baa93
@ -0,0 +1,438 @@
|
|||||||
|
package org.gcube.portlets.user.dataminermanager.client.computations;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.DataMinerWorkAreaEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.DeleteItemRequestEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.RefreshDataMinerWorkAreaEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.events.UIStateEvent;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.rpc.DataMinerPortletServiceAsync;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaElementType;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.shared.exception.ExpiredSessionServiceException;
|
||||||
|
import org.gcube.portlets.user.dataminermanager.shared.workspace.ItemDescription;
|
||||||
|
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||||
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
|
||||||
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
||||||
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||||
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
|
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ComputationsPanel extends FramedPanel {
|
||||||
|
|
||||||
|
private Item selectedItem;
|
||||||
|
private MultipleDNDUpload dnd;
|
||||||
|
private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||||
|
private TextButton btnOpen;
|
||||||
|
private TextButton btnDelete;
|
||||||
|
private TextButton btnRefresh;
|
||||||
|
private TextButton btnResubmit;
|
||||||
|
private TextButton btnCancel;
|
||||||
|
private VerticalLayoutContainer v;
|
||||||
|
|
||||||
|
public ComputationsPanel() {
|
||||||
|
super();
|
||||||
|
Log.debug("ComputationsPanel");
|
||||||
|
|
||||||
|
// msgs = GWT.create(ServiceCategoryMessages.class);
|
||||||
|
init();
|
||||||
|
bindToEvents();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
setId("ComputationsPanel");
|
||||||
|
forceLayoutOnResize = true;
|
||||||
|
setBodyBorder(true);
|
||||||
|
setBodyStyle("backgroundColor:white;");
|
||||||
|
setHeaderVisible(true);
|
||||||
|
setResize(true);
|
||||||
|
setAnimCollapse(false);
|
||||||
|
setHeadingText("Computations");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindToEvents() {
|
||||||
|
|
||||||
|
EventBusProvider.INSTANCE.addHandler(UIStateEvent.TYPE,
|
||||||
|
new UIStateEvent.UIStateEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(UIStateEvent event) {
|
||||||
|
manageStateEvents(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
EventBusProvider.INSTANCE.addHandler(DataMinerWorkAreaEvent.TYPE,
|
||||||
|
new DataMinerWorkAreaEvent.DataMinerWorkAreaEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(DataMinerWorkAreaEvent event) {
|
||||||
|
manageDataMinerWorkAreaEvents(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
EventBusProvider.INSTANCE
|
||||||
|
.addHandler(
|
||||||
|
RefreshDataMinerWorkAreaEvent.TYPE,
|
||||||
|
new RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRefresh(
|
||||||
|
RefreshDataMinerWorkAreaEvent event) {
|
||||||
|
manageRefreshDataMinerWorkAreaEvents(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void manageStateEvents(UIStateEvent event) {
|
||||||
|
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||||
|
+ event.toString());
|
||||||
|
switch (event.getUiStateType()) {
|
||||||
|
case START:
|
||||||
|
break;
|
||||||
|
case WAITING:
|
||||||
|
break;
|
||||||
|
case UPDATE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void manageDataMinerWorkAreaEvents(DataMinerWorkAreaEvent event) {
|
||||||
|
|
||||||
|
Log.debug("ComputationsPanel recieved UIStateEvent: "
|
||||||
|
+ event.toString());
|
||||||
|
switch (event.getDataMinerWorkAreaEventType()) {
|
||||||
|
case OPEN:
|
||||||
|
case UPDATE:
|
||||||
|
refreshWSResourceExplorerPanel(event);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void manageRefreshDataMinerWorkAreaEvents(
|
||||||
|
RefreshDataMinerWorkAreaEvent event) {
|
||||||
|
switch (event.getDataMinerWorkAreaElementType()) {
|
||||||
|
case Computations:
|
||||||
|
refreshWSResourceExplorerPanel();
|
||||||
|
break;
|
||||||
|
case InputDataSets:
|
||||||
|
break;
|
||||||
|
case OutputDataSets:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void create(DataMinerWorkAreaEvent event) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (event == null
|
||||||
|
|| event.getDataMinerWorkArea() == null
|
||||||
|
|| event.getDataMinerWorkArea().getComputations() == null
|
||||||
|
|| event.getDataMinerWorkArea().getComputations()
|
||||||
|
.getFolder() == null
|
||||||
|
|| event.getDataMinerWorkArea().getComputations()
|
||||||
|
.getFolder().getId() == null
|
||||||
|
|| event.getDataMinerWorkArea().getComputations()
|
||||||
|
.getFolder().getId().isEmpty()) {
|
||||||
|
if (v != null) {
|
||||||
|
remove(v);
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||||
|
event.getDataMinerWorkArea().getComputations().getFolder()
|
||||||
|
.getId(), false);
|
||||||
|
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelectedItem(Item item) {
|
||||||
|
Log.debug("Listener Selected Item " + item);
|
||||||
|
selectedItem = item;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Throwable throwable) {
|
||||||
|
Log.error(throwable.getLocalizedMessage());
|
||||||
|
throwable.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAborted() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNotValidSelection() {
|
||||||
|
selectedItem = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
wsResourcesExplorerPanel
|
||||||
|
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||||
|
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||||
|
|
||||||
|
VerticalLayoutContainer vResourcesExplorerContainer = new VerticalLayoutContainer();
|
||||||
|
vResourcesExplorerContainer.setScrollMode(ScrollMode.AUTO);
|
||||||
|
vResourcesExplorerContainer.add(wsResourcesExplorerPanel,
|
||||||
|
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
|
|
||||||
|
// DND
|
||||||
|
|
||||||
|
dnd = new MultipleDNDUpload();
|
||||||
|
dnd.setParameters(event.getDataMinerWorkArea().getComputations()
|
||||||
|
.getFolder().getId(), UPLOAD_TYPE.File);
|
||||||
|
dnd.addUniqueContainer(vResourcesExplorerContainer);
|
||||||
|
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUploadCompleted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload completed: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUploadAborted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String parentId, String itemId,
|
||||||
|
Throwable throwable) {
|
||||||
|
Log.debug("Upload Error: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
throwable.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload Override Completed: [parentID: "
|
||||||
|
+ parentId + ", itemId: " + itemId + "]");
|
||||||
|
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
dnd.addWorkspaceUploadNotificationListener(workspaceUploaderListener);
|
||||||
|
|
||||||
|
// ToolBar
|
||||||
|
btnOpen = new TextButton("Open");
|
||||||
|
// btnOpen.setIcon(StatAlgoImporterResources.INSTANCE.download16());
|
||||||
|
btnOpen.setScale(ButtonScale.SMALL);
|
||||||
|
btnOpen.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnOpen.setToolTip("Open");
|
||||||
|
btnOpen.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
openFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
btnDelete = new TextButton("Delete");
|
||||||
|
// btnDelete.setIcon(StatAlgoImporterResources.INSTANCE.delete16());
|
||||||
|
btnDelete.setScale(ButtonScale.SMALL);
|
||||||
|
btnDelete.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnDelete.setToolTip("Delete");
|
||||||
|
btnDelete.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
deleteItem(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
btnRefresh = new TextButton("Refresh");
|
||||||
|
// btnRefresh.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||||
|
btnRefresh.setScale(ButtonScale.SMALL);
|
||||||
|
btnRefresh.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnRefresh.setToolTip("Refresh");
|
||||||
|
btnRefresh.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
refreshWSResourceExplorerPanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
btnResubmit = new TextButton("Resubmit");
|
||||||
|
// btnResubmit.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||||
|
btnResubmit.setScale(ButtonScale.SMALL);
|
||||||
|
btnResubmit.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnResubmit.setToolTip("Resubmit");
|
||||||
|
btnResubmit.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
resubmitComputation();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
btnCancel = new TextButton("Cancel");
|
||||||
|
// btnCancel.setIcon(StatAlgoImporterResources.INSTANCE.reload16());
|
||||||
|
btnCancel.setScale(ButtonScale.SMALL);
|
||||||
|
btnCancel.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnCancel.setToolTip("Cancel");
|
||||||
|
btnCancel.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
cancelComputation();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
ToolBar toolBar = new ToolBar();
|
||||||
|
toolBar.add(btnOpen, new BoxLayoutData(new Margins(0)));
|
||||||
|
toolBar.add(btnDelete, new BoxLayoutData(new Margins(0)));
|
||||||
|
toolBar.add(btnRefresh, new BoxLayoutData(new Margins(0)));
|
||||||
|
toolBar.add(btnResubmit, new BoxLayoutData(new Margins(0)));
|
||||||
|
toolBar.add(btnCancel, new BoxLayoutData(new Margins(0)));
|
||||||
|
|
||||||
|
v = new VerticalLayoutContainer();
|
||||||
|
|
||||||
|
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
|
v.add(dnd, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||||
|
add(v);
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.error("Error opening wsResourceExplorerPanel");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void refreshWSResourceExplorerPanel() {
|
||||||
|
if (wsResourcesExplorerPanel != null) {
|
||||||
|
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshWSResourceExplorerPanel(DataMinerWorkAreaEvent event) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (v != null) {
|
||||||
|
remove(v);
|
||||||
|
create(event);
|
||||||
|
} else {
|
||||||
|
create(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.error("Error in ComputationsPanel: " + e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteItem(SelectEvent event) {
|
||||||
|
ItemDescription itemDescription = new ItemDescription(
|
||||||
|
selectedItem.getId(), selectedItem.getName(),
|
||||||
|
selectedItem.getOwner(), selectedItem.getPath(), selectedItem
|
||||||
|
.getType().name());
|
||||||
|
DeleteItemRequestEvent deleteItemEvent = new DeleteItemRequestEvent(
|
||||||
|
DataMinerWorkAreaElementType.Computations, itemDescription);
|
||||||
|
EventBusProvider.INSTANCE.fireEvent(deleteItemEvent);
|
||||||
|
Log.debug("Fired: " + deleteItemEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openFile() {
|
||||||
|
if (selectedItem != null && !selectedItem.isFolder()) {
|
||||||
|
|
||||||
|
final ItemDescription itemDescription = new ItemDescription(
|
||||||
|
selectedItem.getId(), selectedItem.getName(),
|
||||||
|
selectedItem.getOwner(), selectedItem.getPath(),
|
||||||
|
selectedItem.getType().name());
|
||||||
|
|
||||||
|
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
|
||||||
|
itemDescription, new AsyncCallback<String>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof ExpiredSessionServiceException) {
|
||||||
|
EventBusProvider.INSTANCE
|
||||||
|
.fireEvent(new SessionExpiredEvent());
|
||||||
|
} else {
|
||||||
|
Log.error("Error open file: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
caught.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String link) {
|
||||||
|
Log.debug("Retrieved link: " + link);
|
||||||
|
Window.open(link, itemDescription.getName(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
UtilsGXT3.info("Attention", "Select a file!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cancelComputation() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resubmitComputation() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.progressWrap {
|
||||||
|
border:1px solid;
|
||||||
|
overflow:hidden;
|
||||||
|
border-color:#65cf6d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressInner {
|
||||||
|
height:18px;
|
||||||
|
background:repeat-x;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBar {
|
||||||
|
height:18px;
|
||||||
|
width:0;
|
||||||
|
border-top:1px solid;
|
||||||
|
border-bottom:1px solid;
|
||||||
|
border-right:1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressText {
|
||||||
|
padding:1px 5px;
|
||||||
|
overflow:hidden;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
text-align:center;
|
||||||
|
font-size:11px;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBar .progressText {
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressTextBack {
|
||||||
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@if user.agent ie6 ie8 ie9 {
|
||||||
|
.progressTextBack {
|
||||||
|
line-height:15px;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.resources.client.ClientBundle;
|
||||||
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||||
|
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||||
|
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GreenProgressBarAppaearance extends ProgressBarDefaultAppearance {
|
||||||
|
|
||||||
|
public interface GreenProgressBarResources extends ProgressBarResources,
|
||||||
|
ClientBundle {
|
||||||
|
|
||||||
|
@Source({ "GreenProgressBar.css" })
|
||||||
|
@Override
|
||||||
|
ProgressBarStyle style();
|
||||||
|
|
||||||
|
@Source("green-progress-bg.gif")
|
||||||
|
@Override
|
||||||
|
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||||
|
ImageResource bar();
|
||||||
|
|
||||||
|
@Source("green-bg.gif")
|
||||||
|
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||||
|
ImageResource innerBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GreenProgressBarAppaearance() {
|
||||||
|
super(
|
||||||
|
GWT.<ProgressBarResources> create(GreenProgressBarResources.class),
|
||||||
|
GWT.<ProgressBarTemplate> create(ProgressBarTemplate.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.progressWrap {
|
||||||
|
border:1px solid;
|
||||||
|
overflow:hidden;
|
||||||
|
border-color:#cf6572;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressInner {
|
||||||
|
height:18px;
|
||||||
|
background:repeat-x;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBar {
|
||||||
|
height:18px;
|
||||||
|
width:0;
|
||||||
|
border-top:1px solid;
|
||||||
|
border-bottom:1px solid;
|
||||||
|
border-right:1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressText {
|
||||||
|
padding:1px 5px;
|
||||||
|
overflow:hidden;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
text-align:center;
|
||||||
|
font-size:11px;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressBar .progressText {
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progressTextBack {
|
||||||
|
z-index: 9 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@if user.agent ie6 ie8 ie9 {
|
||||||
|
.progressTextBack {
|
||||||
|
line-height:15px;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package org.gcube.portlets.user.dataminermanager.client.custom;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.resources.client.ClientBundle;
|
||||||
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
import com.google.gwt.resources.client.ImageResource.ImageOptions;
|
||||||
|
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
|
||||||
|
import com.sencha.gxt.theme.base.client.progress.ProgressBarDefaultAppearance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class RedProgressBarAppaearance extends ProgressBarDefaultAppearance {
|
||||||
|
|
||||||
|
public interface RedProgressBarResources extends ProgressBarResources,
|
||||||
|
ClientBundle {
|
||||||
|
|
||||||
|
@Source({"RedProgressBar.css" })
|
||||||
|
@Override
|
||||||
|
ProgressBarStyle style();
|
||||||
|
|
||||||
|
@Source("red-progress-bg.gif")
|
||||||
|
@Override
|
||||||
|
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||||
|
ImageResource bar();
|
||||||
|
|
||||||
|
@Source("red-bg.gif")
|
||||||
|
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
|
||||||
|
ImageResource innerBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RedProgressBarAppaearance() {
|
||||||
|
super(
|
||||||
|
GWT.<RedProgressBarResources> create(RedProgressBarResources.class),
|
||||||
|
GWT.<ProgressBarTemplate> create(ProgressBarTemplate.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 496 B |
Binary file not shown.
After Width: | Height: | Size: 99 B |
Binary file not shown.
After Width: | Height: | Size: 492 B |
Binary file not shown.
After Width: | Height: | Size: 120 B |
@ -0,0 +1,68 @@
|
|||||||
|
package org.gcube.portlets.user.dataminermanager.client.events;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.dataminermanager.client.type.DataMinerWorkAreaElementType;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.event.shared.HasHandlers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete Item Event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class RefreshDataMinerWorkAreaEvent extends
|
||||||
|
GwtEvent<RefreshDataMinerWorkAreaEvent.RefreshDataMinerWorkAreaEventHandler> {
|
||||||
|
|
||||||
|
public static Type<RefreshDataMinerWorkAreaEventHandler> TYPE = new Type<RefreshDataMinerWorkAreaEventHandler>();
|
||||||
|
private DataMinerWorkAreaElementType dataMinerWorkAreaElementType;
|
||||||
|
|
||||||
|
public interface RefreshDataMinerWorkAreaEventHandler extends EventHandler {
|
||||||
|
void onRefresh(RefreshDataMinerWorkAreaEvent event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HasRefreshDataMinerWorkAreaEventHandler extends HasHandlers {
|
||||||
|
public HandlerRegistration addRefreshDataMinerWorkAreaEventHandler(
|
||||||
|
RefreshDataMinerWorkAreaEventHandler handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RefreshDataMinerWorkAreaEvent(
|
||||||
|
DataMinerWorkAreaElementType dataMinerWorkAreaElementType) {
|
||||||
|
this.dataMinerWorkAreaElementType = dataMinerWorkAreaElementType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(RefreshDataMinerWorkAreaEventHandler handler) {
|
||||||
|
handler.onRefresh(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<RefreshDataMinerWorkAreaEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type<RefreshDataMinerWorkAreaEventHandler> getType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fire(HasHandlers source, RefreshDataMinerWorkAreaEvent deleteItemEvent) {
|
||||||
|
source.fireEvent(deleteItemEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataMinerWorkAreaElementType getDataMinerWorkAreaElementType() {
|
||||||
|
return dataMinerWorkAreaElementType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RefreshDataMinerWorkAreaEvent [dataMinerWorkAreaElementType="
|
||||||
|
+ dataMinerWorkAreaElementType + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue