Updated Task in background
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@99771 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a06d6fae32
commit
e035f60acd
|
@ -30,6 +30,7 @@ import org.gcube.portlets.user.td.tablewidget.client.rows.EditRowDialog;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
||||||
import org.gcube.portlets.user.td.unionwizardwidget.client.UnionWizardTD;
|
import org.gcube.portlets.user.td.unionwizardwidget.client.UnionWizardTD;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.BackgroundRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridContextMenuItemEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridContextMenuItemEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridHeaderColumnMenuItemEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridHeaderColumnMenuItemEvent;
|
||||||
|
@ -38,6 +39,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredE
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.TasksMonitorEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.TasksMonitorEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.WidgetRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.WidgetRequestEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.BackgroundRequestType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.TaskType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.TaskType;
|
||||||
|
@ -202,7 +204,7 @@ public class TabularDataController {
|
||||||
|
|
||||||
public void onGridHeaderColumnMenuItemEvent(
|
public void onGridHeaderColumnMenuItemEvent(
|
||||||
GridHeaderColumnMenuItemEvent event) {
|
GridHeaderColumnMenuItemEvent event) {
|
||||||
Log.debug("Catch Event HeaderColumnMenuItemEvent");
|
Log.debug("Catch Event GridHeaderColumnMenuItemEvent");
|
||||||
doGridHeaderColumnMenuCommand(event);
|
doGridHeaderColumnMenuCommand(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -234,6 +236,7 @@ public class TabularDataController {
|
||||||
new RibbonEvent.RibbonEventHandler() {
|
new RibbonEvent.RibbonEventHandler() {
|
||||||
|
|
||||||
public void onRibbon(RibbonEvent event) {
|
public void onRibbon(RibbonEvent event) {
|
||||||
|
Log.debug("Catch Event RibbonEvent");
|
||||||
doRibbonCommand(event);
|
doRibbonCommand(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -243,7 +246,7 @@ public class TabularDataController {
|
||||||
new TasksMonitorEvent.TasksMonitorEventHandler() {
|
new TasksMonitorEvent.TasksMonitorEventHandler() {
|
||||||
|
|
||||||
public void onTasksMonitorEvent(TasksMonitorEvent event) {
|
public void onTasksMonitorEvent(TasksMonitorEvent event) {
|
||||||
Log.debug("Catch Event HeaderColumnMenuItemEvent");
|
Log.debug("Catch Event TasksMonitorEvent");
|
||||||
doTasksMonitorCommand(event);
|
doTasksMonitorCommand(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -255,7 +258,7 @@ public class TabularDataController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWidgetRequest(WidgetRequestEvent event) {
|
public void onWidgetRequest(WidgetRequestEvent event) {
|
||||||
Log.debug("Catch Event HeaderColumnMenuItemEvent");
|
Log.debug("Catch Event WidgetRequestEvent");
|
||||||
doWidgetRequestCommand(event);
|
doWidgetRequestCommand(event);
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,10 +266,36 @@ public class TabularDataController {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(BackgroundRequestEvent.TYPE,
|
||||||
|
new BackgroundRequestEvent.BackgroundRequestEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackgroundRequest(BackgroundRequestEvent event) {
|
||||||
|
Log.debug("Catch Event BackgroundRequestEvent");
|
||||||
|
doBackgroundRequestCommand(event);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.fireEvent(new UIStateEvent(UIStateType.START));
|
eventBus.fireEvent(new UIStateEvent(UIStateType.START));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void putInBackgroundUIState(){
|
||||||
|
try {
|
||||||
|
closeTabularResource();
|
||||||
|
//TODO Open monitor background and change TR
|
||||||
|
openBackgroundMonitor();
|
||||||
|
openTabularResource(true);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.debug("Put In Background :" + e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Resume state of user interface
|
// Resume state of user interface
|
||||||
protected void resumeUIState() {
|
protected void resumeUIState() {
|
||||||
try {
|
try {
|
||||||
|
@ -425,7 +454,7 @@ public class TabularDataController {
|
||||||
try {
|
try {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case OPEN:
|
case OPEN:
|
||||||
openTabularResource();
|
openTabularResource(false);
|
||||||
break;
|
break;
|
||||||
case CLONE:
|
case CLONE:
|
||||||
cloneTabularResource();
|
cloneTabularResource();
|
||||||
|
@ -469,6 +498,9 @@ public class TabularDataController {
|
||||||
case TIMELINE:
|
case TIMELINE:
|
||||||
openTasksManagerWizard();
|
openTasksManagerWizard();
|
||||||
break;
|
break;
|
||||||
|
case BACKGROUNDTASKS:
|
||||||
|
openBackgroundMonitor();
|
||||||
|
break;
|
||||||
case HISTORY:
|
case HISTORY:
|
||||||
break;
|
break;
|
||||||
case UNDO:
|
case UNDO:
|
||||||
|
@ -631,8 +663,29 @@ public class TabularDataController {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
public void doBackgroundRequestCommand(BackgroundRequestEvent event) {
|
||||||
|
BackgroundRequestType type = event.getBackgroundRequestType();
|
||||||
|
Log.trace("doBackgroundRequestEvent BackgroundRequestType: " + type);
|
||||||
|
try {
|
||||||
|
switch (type) {
|
||||||
|
case BACKGROUND:
|
||||||
|
putInBackgroundUIState();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.error("doBackgroundRequestCommand Error : " + e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void openLogsWindow(){
|
protected void openLogsWindow(){
|
||||||
Log.debug("Request Open Logs Window");
|
Log.debug("Request Open Logs Window");
|
||||||
TDMLogs tdmLogs=new TDMLogs(eventBus);
|
TDMLogs tdmLogs=new TDMLogs(eventBus);
|
||||||
|
@ -661,20 +714,29 @@ public class TabularDataController {
|
||||||
"SDMX Import", eventBus);
|
"SDMX Import", eventBus);
|
||||||
importWizard.addListener(new WizardListener() {
|
importWizard.addListener(new WizardListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void completed(TRId tabularResourceId) {
|
public void completed(TRId tabularResourceId) {
|
||||||
openTable(tabularResourceId);
|
openTable(tabularResourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void failed(Throwable throwable, String reason,
|
public void failed(Throwable throwable, String reason,
|
||||||
String details) {
|
String details) {
|
||||||
UtilsGXT3.alert(reason, details);
|
UtilsGXT3.alert(reason, details);
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
importWizard.show();
|
importWizard.show();
|
||||||
|
@ -696,20 +758,30 @@ public class TabularDataController {
|
||||||
"CSV Export", eventBus);
|
"CSV Export", eventBus);
|
||||||
|
|
||||||
exportWizard.addListener(new WizardListener() {
|
exportWizard.addListener(new WizardListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void completed(TRId id) {
|
||||||
|
resumeUIState();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void aborted() {
|
||||||
|
resumeUIState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void failed(Throwable throwable, String reason,
|
public void failed(Throwable throwable, String reason,
|
||||||
String details) {
|
String details) {
|
||||||
UtilsGXT3.alert(reason, details);
|
UtilsGXT3.alert(reason, details);
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void completed(TRId id) {
|
|
||||||
resumeUIState();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void aborted() {
|
|
||||||
resumeUIState();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
exportWizard.show();
|
exportWizard.show();
|
||||||
|
@ -746,6 +818,11 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -781,6 +858,11 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -818,6 +900,11 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -853,6 +940,12 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -870,19 +963,32 @@ public class TabularDataController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param switchState
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected void openTabularResource() {
|
protected void openTabularResource(final boolean switchState) {
|
||||||
Log.info("Open Tabular Resources");
|
Log.info("Open Tabular Resources");
|
||||||
|
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
GWT.runAsync(new RunAsyncCallback() {
|
||||||
|
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
openWizard();
|
openWizard();
|
||||||
TDOpen tdOpen = new TDOpen(trId,"Open Tabular Resource", eventBus);
|
String title;
|
||||||
|
if(switchState){
|
||||||
|
title="Switches Tabular Resource";
|
||||||
|
} else {
|
||||||
|
title="Open Tabular Resource";
|
||||||
|
}
|
||||||
|
TDOpen tdOpen=new TDOpen(trId,title, eventBus);
|
||||||
tdOpen.addListener(new WizardListener() {
|
tdOpen.addListener(new WizardListener() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -931,6 +1037,11 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void putInBackground() {
|
||||||
|
Log.debug("PutInBakground");
|
||||||
|
}
|
||||||
|
|
||||||
public void aborted() {
|
public void aborted() {
|
||||||
resumeUIState();
|
resumeUIState();
|
||||||
}
|
}
|
||||||
|
@ -1248,6 +1359,15 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void openBackgroundMonitor() {
|
||||||
|
Log.debug("Request Open Monitor Background Tab");
|
||||||
|
WidgetRequestEvent e = new WidgetRequestEvent(
|
||||||
|
WidgetRequestType.MONITORBACKGROUNDPANEL);
|
||||||
|
eventBus.fireEvent(e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void doChangeTableRequestEventCommand(
|
protected void doChangeTableRequestEventCommand(
|
||||||
ChangeTableRequestEvent event) {
|
ChangeTableRequestEvent event) {
|
||||||
Log.debug("Change Table Request: " + event);
|
Log.debug("Change Table Request: " + event);
|
||||||
|
|
|
@ -400,4 +400,11 @@ public interface TabularDataResources extends ClientBundle {
|
||||||
@Source("column-merge.png")
|
@Source("column-merge.png")
|
||||||
ImageResource columnMerge();
|
ImageResource columnMerge();
|
||||||
|
|
||||||
|
@Source("basket-background_32.png")
|
||||||
|
ImageResource basketBackground32();
|
||||||
|
|
||||||
|
@Source("basket-background.png")
|
||||||
|
ImageResource basketBackground();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 793 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -60,6 +60,7 @@ public class FileToolBar {
|
||||||
protected TextButton shareButton;
|
protected TextButton shareButton;
|
||||||
|
|
||||||
protected TextButton timelineButton;
|
protected TextButton timelineButton;
|
||||||
|
protected TextButton backgroundButton;
|
||||||
|
|
||||||
// History
|
// History
|
||||||
protected TextButton historyButton;
|
protected TextButton historyButton;
|
||||||
|
@ -390,9 +391,9 @@ public class FileToolBar {
|
||||||
|
|
||||||
// TimeLine (Tasks)
|
// TimeLine (Tasks)
|
||||||
ButtonGroup taskGroup = new ButtonGroup();
|
ButtonGroup taskGroup = new ButtonGroup();
|
||||||
taskGroup.setId("Template");
|
taskGroup.setId("TasksStatus");
|
||||||
taskGroup.setStyleName("ribbon");
|
taskGroup.setStyleName("ribbon");
|
||||||
taskGroup.setHeadingText("Timeline");
|
taskGroup.setHeadingText("Tasks");
|
||||||
toolBar.add(taskGroup);
|
toolBar.add(taskGroup);
|
||||||
|
|
||||||
FlexTable taskLayout = new FlexTable();
|
FlexTable taskLayout = new FlexTable();
|
||||||
|
@ -414,6 +415,24 @@ public class FileToolBar {
|
||||||
|
|
||||||
taskLayout.setWidget(0, 0, timelineButton);
|
taskLayout.setWidget(0, 0, timelineButton);
|
||||||
taskLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
taskLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||||
|
|
||||||
|
backgroundButton = new TextButton("Background",
|
||||||
|
TabularDataResources.INSTANCE.basketBackground32());
|
||||||
|
backgroundButton.enable();
|
||||||
|
backgroundButton.setToolTip("Tasks in background");
|
||||||
|
backgroundButton.setScale(ButtonScale.LARGE);
|
||||||
|
backgroundButton.setIconAlign(IconAlign.TOP);
|
||||||
|
backgroundButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
backgroundButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
eventBus.fireEvent(new RibbonEvent(RibbonType.BACKGROUNDTASKS));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
taskLayout.setWidget(0, 1, backgroundButton);
|
||||||
|
taskLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
|
|
||||||
cleanCells(taskLayout.getElement());
|
cleanCells(taskLayout.getElement());
|
||||||
|
|
||||||
// History Group
|
// History Group
|
||||||
|
@ -565,6 +584,7 @@ public class FileToolBar {
|
||||||
templateNewButton.enable();
|
templateNewButton.enable();
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
timelineButton.disable();
|
timelineButton.disable();
|
||||||
|
backgroundButton.enable();
|
||||||
historyButton.disable();
|
historyButton.disable();
|
||||||
undoButton.disable();
|
undoButton.disable();
|
||||||
//discardAllButton.disable();
|
//discardAllButton.disable();
|
||||||
|
@ -587,6 +607,7 @@ public class FileToolBar {
|
||||||
templateNewButton.enable();
|
templateNewButton.enable();
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
timelineButton.disable();
|
timelineButton.disable();
|
||||||
|
backgroundButton.enable();
|
||||||
historyButton.disable();
|
historyButton.disable();
|
||||||
undoButton.disable();
|
undoButton.disable();
|
||||||
//discardAllButton.disable();
|
//discardAllButton.disable();
|
||||||
|
@ -615,6 +636,7 @@ public class FileToolBar {
|
||||||
templateNewButton.enable();
|
templateNewButton.enable();
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
timelineButton.enable();
|
timelineButton.enable();
|
||||||
|
backgroundButton.enable();
|
||||||
historyButton.enable();
|
historyButton.enable();
|
||||||
undoButton.enable();
|
undoButton.enable();
|
||||||
//discardAllButton.disable();
|
//discardAllButton.disable();
|
||||||
|
@ -636,6 +658,7 @@ public class FileToolBar {
|
||||||
templateNewButton.disable();
|
templateNewButton.disable();
|
||||||
templateDeleteButton.disable();
|
templateDeleteButton.disable();
|
||||||
timelineButton.disable();
|
timelineButton.disable();
|
||||||
|
backgroundButton.disable();
|
||||||
historyButton.disable();
|
historyButton.disable();
|
||||||
undoButton.disable();
|
undoButton.disable();
|
||||||
//discardAllButton.disable();
|
//discardAllButton.disable();
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 793 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue