Updated Ambiguous

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@98559 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-10 16:14:55 +00:00 committed by Giancarlo Panichi
parent c4c11654f1
commit 85767c69fe
1 changed files with 13 additions and 29 deletions

View File

@ -200,7 +200,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
protected void create() { protected void create() {
con = new VerticalLayoutContainer(); con = new VerticalLayoutContainer();
con.setScrollMode(ScrollMode.AUTO); con.setScrollMode(ScrollMode.AUTO);
// con.setAdjustForScroll(true);
store = new TreeStore<BaseDto>(new KeyProvider()); store = new TreeStore<BaseDto>(new KeyProvider());
@ -226,23 +226,9 @@ public class ValidationsTasksPanel extends FramedPanel implements
} }
}); });
/*
* ColumnConfig<BaseDto, String> cc2 = new ColumnConfig<BaseDto,
* String>( new ValueProvider<BaseDto, String>() {
*
* @Override public String getValue(BaseDto object) { return object
* instanceof ValidationDto ? ((ValidationDto) object) .getDescription()
* : ""; }
*
* @Override public void setValue(BaseDto object, String value) { if
* (object instanceof ValidationDto) { ((ValidationDto)
* object).setDescription(value); } }
*
* @Override public String getPath() { return "description"; } });
* cc2.setHeader("Description");
*/
ColumnConfig<BaseDto, Boolean> cc3 = new ColumnConfig<BaseDto, Boolean>(
ColumnConfig<BaseDto, Boolean> cc2 = new ColumnConfig<BaseDto, Boolean>(
new ValueProvider<BaseDto, Boolean>() { new ValueProvider<BaseDto, Boolean>() {
@Override @Override
@ -263,7 +249,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
return "valid"; return "valid";
} }
}, 38, "Valid"); }, 38, "Valid");
cc3.setHeader("Valid"); cc2.setHeader("Valid");
ValidationCell validationButton = new ValidationCell(); ValidationCell validationButton = new ValidationCell();
validationButton.setTrueIcon(ResourceBundle.INSTANCE.ok()); validationButton.setTrueIcon(ResourceBundle.INSTANCE.ok());
@ -280,12 +266,12 @@ public class ValidationsTasksPanel extends FramedPanel implements
* } }); * } });
*/ */
cc3.setCell(validationButton); cc2.setCell(validationButton);
List<ColumnConfig<BaseDto, ?>> l = new ArrayList<ColumnConfig<BaseDto, ?>>(); List<ColumnConfig<BaseDto, ?>> l = new ArrayList<ColumnConfig<BaseDto, ?>>();
l.add(cc1); l.add(cc1);
// l.add(cc2); // l.add(cc2);
l.add(cc3); l.add(cc2);
ColumnModel<BaseDto> cm = new ColumnModel<BaseDto>(l); ColumnModel<BaseDto> cm = new ColumnModel<BaseDto>(l);
tree = new TreeGrid<BaseDto>(store, cm, cc1); tree = new TreeGrid<BaseDto>(store, cm, cc1);
@ -346,7 +332,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
TextButton btnExpandAll = new TextButton(); TextButton btnExpandAll = new TextButton();
// btnReload.setText("Expand All");
btnExpandAll.setIcon(ResourceBundle.INSTANCE.magnifierZoomIn()); btnExpandAll.setIcon(ResourceBundle.INSTANCE.magnifierZoomIn());
btnExpandAll.setToolTip("Expand All"); btnExpandAll.setToolTip("Expand All");
btnExpandAll.addSelectHandler(new SelectHandler() { btnExpandAll.addSelectHandler(new SelectHandler() {
@ -360,7 +345,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
toolBar.add(btnExpandAll); toolBar.add(btnExpandAll);
TextButton btnCollapseAll = new TextButton(); TextButton btnCollapseAll = new TextButton();
// btnReload.setText("Expand All");
btnCollapseAll.setIcon(ResourceBundle.INSTANCE.magnifierZoomOut()); btnCollapseAll.setIcon(ResourceBundle.INSTANCE.magnifierZoomOut());
btnCollapseAll.setToolTip("Collapse All"); btnCollapseAll.setToolTip("Collapse All");
btnCollapseAll.addSelectHandler(new SelectHandler() { btnCollapseAll.addSelectHandler(new SelectHandler() {
@ -378,6 +362,8 @@ public class ValidationsTasksPanel extends FramedPanel implements
add(con, new MarginData(0)); add(con, new MarginData(0));
forceLayout();
} }
protected void requestSolution(Context context) { protected void requestSolution(Context context) {
@ -387,7 +373,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
} }
protected void requestResolve(BaseDto d) { protected void requestResolve(BaseDto d) {
// String title = "";
if (d != null) { if (d != null) {
Log.debug(d.toString()); Log.debug(d.toString());
if (d instanceof ValidationDto) { if (d instanceof ValidationDto) {
@ -402,12 +387,12 @@ public class ValidationsTasksPanel extends FramedPanel implements
} else { } else {
if (v.getInvocation() != null) { if (v.getInvocation() != null) {
InvocationS invocationS = v.getInvocation(); InvocationS invocationS = v.getInvocation();
// title = invocationS.toString();
Long op = invocationS.getOperationId(); Long op = invocationS.getOperationId();
if (op.compareTo(OperationsId.ChangeToDimensionColumn if (op.compareTo(OperationsId.ChangeToDimensionColumn
.toLong()) == 0) { .toLong()) == 0) {
if (v.getConditionCode() == ConditionCode.MissingValueOnExternalReference if (v.getConditionCode() == ConditionCode.MissingValueOnExternalReference
|| v.getConditionCode() == ConditionCode.AmbigousValueOnExternalReference) { || v.getConditionCode() == ConditionCode.AmbiguousValueOnExternalReference) {
WidgetRequestEvent widgetRequestEvent = new WidgetRequestEvent( WidgetRequestEvent widgetRequestEvent = new WidgetRequestEvent(
WidgetRequestType.CURATIONBYREPLACEBATCHDIALOG); WidgetRequestType.CURATIONBYREPLACEBATCHDIALOG);
widgetRequestEvent.setTrId(trId); widgetRequestEvent.setTrId(trId);
@ -501,7 +486,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
} }
}); });
// contextMenu.add(resumeItem);
tree.setContextMenu(contextMenu); tree.setContextMenu(contextMenu);
@ -532,7 +517,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
if (op.compareTo(OperationsId.ChangeToDimensionColumn if (op.compareTo(OperationsId.ChangeToDimensionColumn
.toLong()) == 0 .toLong()) == 0
&& (v.getConditionCode() == ConditionCode.MissingValueOnExternalReference || v && (v.getConditionCode() == ConditionCode.MissingValueOnExternalReference || v
.getConditionCode() == ConditionCode.AmbigousValueOnExternalReference)) { .getConditionCode() == ConditionCode.AmbiguousValueOnExternalReference)) {
contextMenu.clear(); contextMenu.clear();
contextMenu.add(resolveItem); contextMenu.add(resolveItem);
contextMenu.add(resumeItem); contextMenu.add(resumeItem);
@ -592,13 +577,12 @@ public class ValidationsTasksPanel extends FramedPanel implements
public void update() { public void update() {
retrieveCurrentTR(); retrieveCurrentTR();
forceLayout();
} }
public void update(TRId trId) { public void update(TRId trId) {
this.trId = trId; this.trId = trId;
draw(); draw();
forceLayout();
} }
protected void retrieveCurrentTR() { protected void retrieveCurrentTR() {