Added Delete Validations
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@115470 82a268e6-3cf1-43bd-a215-b396298e98cf
|
@ -48,6 +48,7 @@ import org.gcube.portlets.user.td.tablewidget.client.history.HistoryDiscard;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.rows.DeleteRows;
|
import org.gcube.portlets.user.td.tablewidget.client.rows.DeleteRows;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.rows.EditRowDialog;
|
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.tablewidget.client.validation.ValidationsDelete;
|
||||||
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.BackgroundRequestEvent;
|
||||||
|
@ -108,7 +109,6 @@ import com.sencha.gxt.widget.core.client.event.DialogHideEvent.DialogHideHandler
|
||||||
*/
|
*/
|
||||||
public class TabularDataController {
|
public class TabularDataController {
|
||||||
|
|
||||||
|
|
||||||
private SimpleEventBus eventBus;
|
private SimpleEventBus eventBus;
|
||||||
private MainBoxPanel mainBoxPanel;
|
private MainBoxPanel mainBoxPanel;
|
||||||
private UIStateType uiState = UIStateType.START;
|
private UIStateType uiState = UIStateType.START;
|
||||||
|
@ -134,8 +134,6 @@ public class TabularDataController {
|
||||||
*/
|
*/
|
||||||
private TRId openTRIdAfterServerUpdate;
|
private TRId openTRIdAfterServerUpdate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TabularDataController() {
|
public TabularDataController() {
|
||||||
eventBus = new SimpleEventBus();
|
eventBus = new SimpleEventBus();
|
||||||
callHello();
|
callHello();
|
||||||
|
@ -793,6 +791,12 @@ public class TabularDataController {
|
||||||
case LOGS:
|
case LOGS:
|
||||||
openLogsWindow();
|
openLogsWindow();
|
||||||
break;
|
break;
|
||||||
|
case VALIDATIONS_SHOW:
|
||||||
|
openValidations();
|
||||||
|
break;
|
||||||
|
case VALIDATIONS_DELETE:
|
||||||
|
validationsDelete();
|
||||||
|
break;
|
||||||
case DUPLICATE_DETECTION:
|
case DUPLICATE_DETECTION:
|
||||||
openDuplicatesRowsDetection();
|
openDuplicatesRowsDetection();
|
||||||
break;
|
break;
|
||||||
|
@ -1430,7 +1434,8 @@ public class TabularDataController {
|
||||||
trId = id;
|
trId = id;
|
||||||
uiState = UIStateType.TR_OPEN;
|
uiState = UIStateType.TR_OPEN;
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(
|
UIStateEvent uiStateEvent = new UIStateEvent(
|
||||||
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
|
UIStateType.TR_OPEN, trId,
|
||||||
|
DataViewType.RESOURCES);
|
||||||
eventBus.fireEvent(uiStateEvent);
|
eventBus.fireEvent(uiStateEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1474,7 +1479,8 @@ public class TabularDataController {
|
||||||
trId = id;
|
trId = id;
|
||||||
uiState = UIStateType.TR_OPEN;
|
uiState = UIStateType.TR_OPEN;
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(
|
UIStateEvent uiStateEvent = new UIStateEvent(
|
||||||
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
|
UIStateType.TR_OPEN, trId,
|
||||||
|
DataViewType.RESOURCES);
|
||||||
eventBus.fireEvent(uiStateEvent);
|
eventBus.fireEvent(uiStateEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1605,6 +1611,7 @@ public class TabularDataController {
|
||||||
(Window.getClientWidth() / 2) - 200,
|
(Window.getClientWidth() / 2) - 200,
|
||||||
(Window.getClientHeight() / 2) - 300);
|
(Window.getClientHeight() / 2) - 300);
|
||||||
tdTaskController.updateTasks(true);
|
tdTaskController.updateTasks(true);
|
||||||
|
tdTaskMainWindow.setModal(true);
|
||||||
tdTaskMainWindow.show();
|
tdTaskMainWindow.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1632,6 +1639,7 @@ public class TabularDataController {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
TdTemplateController tdTemplateController = new TdTemplateController();
|
TdTemplateController tdTemplateController = new TdTemplateController();
|
||||||
TdTemplateController.bindCommonBus(eventBus);
|
TdTemplateController.bindCommonBus(eventBus);
|
||||||
|
tdTemplateController.getWindowTemplatePanel().setModal(true);
|
||||||
tdTemplateController.getWindowTemplatePanel().show();
|
tdTemplateController.getWindowTemplatePanel().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1807,8 +1815,8 @@ public class TabularDataController {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.debug("Request Open On Column Apply Rule Dialog");
|
Log.debug("Request Open On Column Apply Rule Dialog");
|
||||||
if (trId != null) {
|
if (trId != null) {
|
||||||
RuleOnColumnApplyDialog raDialog = new RuleOnColumnApplyDialog(trId,
|
RuleOnColumnApplyDialog raDialog = new RuleOnColumnApplyDialog(
|
||||||
eventBus);
|
trId, eventBus);
|
||||||
raDialog.show();
|
raDialog.show();
|
||||||
} else {
|
} else {
|
||||||
Log.error("TRId is null");
|
Log.error("TRId is null");
|
||||||
|
@ -2293,6 +2301,28 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openValidations() {
|
||||||
|
Log.debug("Request Validations Tab");
|
||||||
|
if (trId != null) {
|
||||||
|
WidgetRequestEvent e = new WidgetRequestEvent(
|
||||||
|
WidgetRequestType.VALIDATIONSTASKSPANEL);
|
||||||
|
e.setTrId(trId);
|
||||||
|
eventBus.fireEvent(e);
|
||||||
|
} else {
|
||||||
|
Log.error("TRId is null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validationsDelete() {
|
||||||
|
Log.debug("Call Validation Delete");
|
||||||
|
if (trId != null) {
|
||||||
|
new ValidationsDelete(trId, eventBus);
|
||||||
|
} else {
|
||||||
|
Log.error("TRId is null");
|
||||||
|
UtilsGXT3.alert("Error", "No tabular resource present");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void openDuplicatesRowsDelete() {
|
private void openDuplicatesRowsDelete() {
|
||||||
Log.debug("Request Duplicates Rows Delete Tab");
|
Log.debug("Request Duplicates Rows Delete Tab");
|
||||||
if (trId != null) {
|
if (trId != null) {
|
||||||
|
|
|
@ -124,12 +124,20 @@ public interface TabularDataResources extends ClientBundle {
|
||||||
@Source("statistical_32.png")
|
@Source("statistical_32.png")
|
||||||
ImageResource statistical32();
|
ImageResource statistical32();
|
||||||
|
|
||||||
@Source("table-validate_32.png")
|
|
||||||
|
@Source("table-validation_32.png")
|
||||||
ImageResource validation32();
|
ImageResource validation32();
|
||||||
|
|
||||||
@Source("table-validate.png")
|
@Source("table-validation.png")
|
||||||
ImageResource validation();
|
ImageResource validation();
|
||||||
|
|
||||||
|
@Source("table-validation-delete_32.png")
|
||||||
|
ImageResource validationDelete32();
|
||||||
|
|
||||||
|
@Source("table-validation-delete.png")
|
||||||
|
ImageResource validationDelete();
|
||||||
|
|
||||||
|
|
||||||
@Source("rule-add_32.png")
|
@Source("rule-add_32.png")
|
||||||
ImageResource ruleAdd32();
|
ImageResource ruleAdd32();
|
||||||
|
|
||||||
|
@ -335,6 +343,12 @@ public interface TabularDataResources extends ClientBundle {
|
||||||
@Source("column.png")
|
@Source("column.png")
|
||||||
ImageResource column();
|
ImageResource column();
|
||||||
|
|
||||||
|
@Source("column-validation-delete_32.png")
|
||||||
|
ImageResource columnValidationDelete32();
|
||||||
|
|
||||||
|
@Source("column-validation-delete.png")
|
||||||
|
ImageResource columnValidationDelete();
|
||||||
|
|
||||||
@Source("cog_32.png")
|
@Source("cog_32.png")
|
||||||
ImageResource cog32();
|
ImageResource cog32();
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 938 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 1.7 KiB |
|
@ -38,8 +38,11 @@ public class CurationToolBar {
|
||||||
private ToolBar toolBar;
|
private ToolBar toolBar;
|
||||||
|
|
||||||
//Validation
|
//Validation
|
||||||
|
private TextButton validationsShowButton;
|
||||||
|
private TextButton validationsDeleteButton;
|
||||||
private TextButton duplicateDetectionButton;
|
private TextButton duplicateDetectionButton;
|
||||||
|
|
||||||
|
|
||||||
//Structure
|
//Structure
|
||||||
private TextButton tableTypeButton;
|
private TextButton tableTypeButton;
|
||||||
private TextButton changePositionColumnButton;
|
private TextButton changePositionColumnButton;
|
||||||
|
@ -58,6 +61,7 @@ public class CurationToolBar {
|
||||||
private TextButton codelistMappingButton;
|
private TextButton codelistMappingButton;
|
||||||
//private TextButton generateSummaryButton;
|
//private TextButton generateSummaryButton;
|
||||||
|
|
||||||
|
|
||||||
public CurationToolBar(EventBus eventBus) {
|
public CurationToolBar(EventBus eventBus) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
build();
|
build();
|
||||||
|
@ -85,6 +89,46 @@ public class CurationToolBar {
|
||||||
FlexTable validationLayout = new FlexTable();
|
FlexTable validationLayout = new FlexTable();
|
||||||
validationGroup.add(validationLayout);
|
validationGroup.add(validationLayout);
|
||||||
|
|
||||||
|
validationsShowButton = new TextButton(msgs.validationsShowButton(),
|
||||||
|
TabularDataResources.INSTANCE.validation32());
|
||||||
|
validationsShowButton.disable();
|
||||||
|
validationsShowButton.setScale(ButtonScale.LARGE);
|
||||||
|
validationsShowButton.setIconAlign(IconAlign.TOP);
|
||||||
|
validationsShowButton
|
||||||
|
.setToolTip(msgs.validationsShowButtonToolTip());
|
||||||
|
validationsShowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
validationsShowButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
|
RibbonType.VALIDATIONS_SHOW));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
validationLayout.setWidget(0, 0, validationsShowButton);
|
||||||
|
validationLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
validationsDeleteButton = new TextButton(msgs.validationsDeleteButton(),
|
||||||
|
TabularDataResources.INSTANCE.validationDelete32());
|
||||||
|
validationsDeleteButton.disable();
|
||||||
|
validationsDeleteButton.setScale(ButtonScale.LARGE);
|
||||||
|
validationsDeleteButton.setIconAlign(IconAlign.TOP);
|
||||||
|
validationsDeleteButton
|
||||||
|
.setToolTip(msgs.validationsDeleteButtonToolTip());
|
||||||
|
validationsDeleteButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
validationsDeleteButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
|
RibbonType.VALIDATIONS_DELETE));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
validationLayout.setWidget(0, 1, validationsDeleteButton);
|
||||||
|
validationLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
|
|
||||||
duplicateDetectionButton = new TextButton(msgs.duplicateDetectionButton(),
|
duplicateDetectionButton = new TextButton(msgs.duplicateDetectionButton(),
|
||||||
TabularDataResources.INSTANCE.tableDuplicateRows32());
|
TabularDataResources.INSTANCE.tableDuplicateRows32());
|
||||||
|
@ -102,10 +146,8 @@ public class CurationToolBar {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
validationLayout.setWidget(0, 0, duplicateDetectionButton);
|
validationLayout.setWidget(0, 2, duplicateDetectionButton);
|
||||||
validationLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
validationLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cleanCells(validationLayout.getElement());
|
cleanCells(validationLayout.getElement());
|
||||||
|
|
||||||
|
@ -393,6 +435,8 @@ public class CurationToolBar {
|
||||||
try {
|
try {
|
||||||
switch (uiStateType) {
|
switch (uiStateType) {
|
||||||
case START:
|
case START:
|
||||||
|
validationsShowButton.disable();
|
||||||
|
validationsDeleteButton.disable();
|
||||||
duplicateDetectionButton.disable();
|
duplicateDetectionButton.disable();
|
||||||
|
|
||||||
tableTypeButton.disable();
|
tableTypeButton.disable();
|
||||||
|
@ -413,6 +457,8 @@ public class CurationToolBar {
|
||||||
break;
|
break;
|
||||||
case TR_CLOSE:
|
case TR_CLOSE:
|
||||||
case TR_READONLY:
|
case TR_READONLY:
|
||||||
|
validationsShowButton.disable();
|
||||||
|
validationsDeleteButton.disable();
|
||||||
duplicateDetectionButton.disable();
|
duplicateDetectionButton.disable();
|
||||||
|
|
||||||
tableTypeButton.disable();
|
tableTypeButton.disable();
|
||||||
|
@ -433,6 +479,8 @@ public class CurationToolBar {
|
||||||
case TR_OPEN:
|
case TR_OPEN:
|
||||||
case TABLEUPDATE:
|
case TABLEUPDATE:
|
||||||
case TABLECURATION:
|
case TABLECURATION:
|
||||||
|
validationsShowButton.enable();
|
||||||
|
validationsDeleteButton.enable();
|
||||||
duplicateDetectionButton.enable();
|
duplicateDetectionButton.enable();
|
||||||
|
|
||||||
tableTypeButton.enable();
|
tableTypeButton.enable();
|
||||||
|
@ -457,6 +505,8 @@ public class CurationToolBar {
|
||||||
//generateSummaryButton.disable();
|
//generateSummaryButton.disable();
|
||||||
break;
|
break;
|
||||||
case WIZARD_OPEN:
|
case WIZARD_OPEN:
|
||||||
|
validationsShowButton.disable();
|
||||||
|
validationsDeleteButton.disable();
|
||||||
duplicateDetectionButton.disable();
|
duplicateDetectionButton.disable();
|
||||||
|
|
||||||
tableTypeButton.disable();
|
tableTypeButton.disable();
|
||||||
|
|
|
@ -13,6 +13,18 @@ public interface CurationToolBarMessages extends Messages {
|
||||||
@DefaultMessage("Validation")
|
@DefaultMessage("Validation")
|
||||||
String validationGroupHeadingText();
|
String validationGroupHeadingText();
|
||||||
|
|
||||||
|
@DefaultMessage("Show")
|
||||||
|
String validationsShowButton();
|
||||||
|
|
||||||
|
@DefaultMessage("Show Validations")
|
||||||
|
String validationsShowButtonToolTip();
|
||||||
|
|
||||||
|
@DefaultMessage("Delete")
|
||||||
|
String validationsDeleteButton();
|
||||||
|
|
||||||
|
@DefaultMessage("Delete Validations")
|
||||||
|
String validationsDeleteButtonToolTip();
|
||||||
|
|
||||||
@DefaultMessage("Duplicate Detection")
|
@DefaultMessage("Duplicate Detection")
|
||||||
String duplicateDetectionButton();
|
String duplicateDetectionButton();
|
||||||
|
|
||||||
|
@ -99,4 +111,6 @@ public interface CurationToolBarMessages extends Messages {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -48,7 +48,6 @@ public class TabularDataRibbon {
|
||||||
|
|
||||||
curationToolBar = new CurationToolBar(eventBus);
|
curationToolBar = new CurationToolBar(eventBus);
|
||||||
con = new VerticalLayoutContainer();
|
con = new VerticalLayoutContainer();
|
||||||
|
|
||||||
con.add(curationToolBar.getToolBar(), vldata);
|
con.add(curationToolBar.getToolBar(), vldata);
|
||||||
ribbon.add(con, msgs.curation());
|
ribbon.add(con, msgs.curation());
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 815 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 938 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 1.7 KiB |
|
@ -390,9 +390,9 @@ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,bloc
|
||||||
.x-modal {
|
.x-modal {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: black;
|
background-color: #CEDFF5;
|
||||||
filter: alpha(opacity = 10);
|
filter: alpha(opacity = 10);
|
||||||
opacity: .1;
|
opacity: .4;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,9 +390,9 @@ html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,bloc
|
||||||
.x-modal {
|
.x-modal {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: black;
|
background-color: #CEDFF5;
|
||||||
filter: alpha(opacity = 10);
|
filter: alpha(opacity = 10);
|
||||||
opacity: .1;
|
opacity: .4;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
}
|
}
|
||||||
|
|