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
This commit is contained in:
Giancarlo Panichi 2015-06-22 15:24:39 +00:00
parent b476f443dc
commit d2caec4ee4
19 changed files with 132 additions and 25 deletions

View File

@ -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.EditRowDialog;
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.unionwizardwidget.client.UnionWizardTD;
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 {
private SimpleEventBus eventBus;
private MainBoxPanel mainBoxPanel;
private UIStateType uiState = UIStateType.START;
@ -134,8 +134,6 @@ public class TabularDataController {
*/
private TRId openTRIdAfterServerUpdate;
public TabularDataController() {
eventBus = new SimpleEventBus();
callHello();
@ -793,6 +791,12 @@ public class TabularDataController {
case LOGS:
openLogsWindow();
break;
case VALIDATIONS_SHOW:
openValidations();
break;
case VALIDATIONS_DELETE:
validationsDelete();
break;
case DUPLICATE_DETECTION:
openDuplicatesRowsDetection();
break;
@ -1427,10 +1431,11 @@ public class TabularDataController {
}
public void completed(TRId id) {
trId=id;
trId = id;
uiState = UIStateType.TR_OPEN;
UIStateEvent uiStateEvent = new UIStateEvent(
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
UIStateType.TR_OPEN, trId,
DataViewType.RESOURCES);
eventBus.fireEvent(uiStateEvent);
}
@ -1471,10 +1476,11 @@ public class TabularDataController {
}
public void completed(TRId id) {
trId=id;
trId = id;
uiState = UIStateType.TR_OPEN;
UIStateEvent uiStateEvent = new UIStateEvent(
UIStateType.TR_OPEN, trId, DataViewType.RESOURCES);
UIStateType.TR_OPEN, trId,
DataViewType.RESOURCES);
eventBus.fireEvent(uiStateEvent);
}
@ -1605,6 +1611,7 @@ public class TabularDataController {
(Window.getClientWidth() / 2) - 200,
(Window.getClientHeight() / 2) - 300);
tdTaskController.updateTasks(true);
tdTaskMainWindow.setModal(true);
tdTaskMainWindow.show();
}
@ -1632,6 +1639,7 @@ public class TabularDataController {
public void onSuccess() {
TdTemplateController tdTemplateController = new TdTemplateController();
TdTemplateController.bindCommonBus(eventBus);
tdTemplateController.getWindowTemplatePanel().setModal(true);
tdTemplateController.getWindowTemplatePanel().show();
}
@ -1807,8 +1815,8 @@ public class TabularDataController {
public void onSuccess() {
Log.debug("Request Open On Column Apply Rule Dialog");
if (trId != null) {
RuleOnColumnApplyDialog raDialog = new RuleOnColumnApplyDialog(trId,
eventBus);
RuleOnColumnApplyDialog raDialog = new RuleOnColumnApplyDialog(
trId, eventBus);
raDialog.show();
} else {
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() {
Log.debug("Request Duplicates Rows Delete Tab");
if (trId != null) {

View File

@ -124,12 +124,20 @@ public interface TabularDataResources extends ClientBundle {
@Source("statistical_32.png")
ImageResource statistical32();
@Source("table-validate_32.png")
@Source("table-validation_32.png")
ImageResource validation32();
@Source("table-validate.png")
@Source("table-validation.png")
ImageResource validation();
@Source("table-validation-delete_32.png")
ImageResource validationDelete32();
@Source("table-validation-delete.png")
ImageResource validationDelete();
@Source("rule-add_32.png")
ImageResource ruleAdd32();
@ -334,6 +342,12 @@ public interface TabularDataResources extends ClientBundle {
@Source("column.png")
ImageResource column();
@Source("column-validation-delete_32.png")
ImageResource columnValidationDelete32();
@Source("column-validation-delete.png")
ImageResource columnValidationDelete();
@Source("cog_32.png")
ImageResource cog32();

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -38,8 +38,11 @@ public class CurationToolBar {
private ToolBar toolBar;
//Validation
private TextButton validationsShowButton;
private TextButton validationsDeleteButton;
private TextButton duplicateDetectionButton;
//Structure
private TextButton tableTypeButton;
private TextButton changePositionColumnButton;
@ -57,6 +60,7 @@ public class CurationToolBar {
private TextButton extractCodelistButton;
private TextButton codelistMappingButton;
//private TextButton generateSummaryButton;
public CurationToolBar(EventBus eventBus) {
this.eventBus = eventBus;
@ -85,6 +89,46 @@ public class CurationToolBar {
FlexTable validationLayout = new FlexTable();
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(),
TabularDataResources.INSTANCE.tableDuplicateRows32());
@ -102,11 +146,9 @@ public class CurationToolBar {
}
});
validationLayout.setWidget(0, 0, duplicateDetectionButton);
validationLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
validationLayout.setWidget(0, 2, duplicateDetectionButton);
validationLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
cleanCells(validationLayout.getElement());
// Structure
@ -393,6 +435,8 @@ public class CurationToolBar {
try {
switch (uiStateType) {
case START:
validationsShowButton.disable();
validationsDeleteButton.disable();
duplicateDetectionButton.disable();
tableTypeButton.disable();
@ -413,6 +457,8 @@ public class CurationToolBar {
break;
case TR_CLOSE:
case TR_READONLY:
validationsShowButton.disable();
validationsDeleteButton.disable();
duplicateDetectionButton.disable();
tableTypeButton.disable();
@ -433,8 +479,10 @@ public class CurationToolBar {
case TR_OPEN:
case TABLEUPDATE:
case TABLECURATION:
validationsShowButton.enable();
validationsDeleteButton.enable();
duplicateDetectionButton.enable();
tableTypeButton.enable();
changePositionColumnButton.enable();
changeColumnLabelButton.enable();
@ -457,6 +505,8 @@ public class CurationToolBar {
//generateSummaryButton.disable();
break;
case WIZARD_OPEN:
validationsShowButton.disable();
validationsDeleteButton.disable();
duplicateDetectionButton.disable();
tableTypeButton.disable();

View File

@ -12,13 +12,25 @@ public interface CurationToolBarMessages extends Messages {
@DefaultMessage("Validation")
String validationGroupHeadingText();
@DefaultMessage("Show")
String validationsShowButton();
@DefaultMessage("Show Validations")
String validationsShowButtonToolTip();
@DefaultMessage("Delete")
String validationsDeleteButton();
@DefaultMessage("Delete Validations")
String validationsDeleteButtonToolTip();
@DefaultMessage("Duplicate Detection")
String duplicateDetectionButton();
@DefaultMessage("Detects duplicate lines in the table")
String duplicateDetectionButtonToolTip();
@DefaultMessage("Structure")
String structureGroupHeadingText();
@ -96,6 +108,8 @@ public interface CurationToolBarMessages extends Messages {
@DefaultMessage("Codelist Mapping Import")
String codelistMappingButtonToolTip();

View File

@ -48,7 +48,6 @@ public class TabularDataRibbon {
curationToolBar = new CurationToolBar(eventBus);
con = new VerticalLayoutContainer();
con.add(curationToolBar.getToolBar(), vldata);
ribbon.add(con, msgs.curation());

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -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 {
position: absolute;
z-index: 10;
background-color: black;
filter: alpha(opacity = 10);
opacity: .1;
background-color: #CEDFF5;
filter: alpha(opacity = 10);
opacity: .4;
left: 0px;
top: 0px;
}

View File

@ -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 {
position: absolute;
z-index: 10;
background-color: black;
filter: alpha(opacity = 10);
opacity: .1;
background-color: #CEDFF5;
filter: alpha(opacity = 10);
opacity: .4;
left: 0px;
top: 0px;
}