diff --git a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java index f4d8179..2f4edce 100644 --- a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/validation/ValidationsTasksPanel.java @@ -92,14 +92,19 @@ public class ValidationsTasksPanel extends FramedPanel implements protected TreeDataGenerator gen; protected TreeStore store; protected TreeGrid tree; - + + class KeyProvider implements ModelKeyProvider { @Override public String getKey(BaseDto item) { return (item instanceof FolderDto ? "f-" : "v-") + item.getId(); } } - + + /** + * + * @param eventBus + */ public ValidationsTasksPanel(EventBus eventBus) { super(); Log.debug("ValidationsTasksPanel"); @@ -109,7 +114,12 @@ public class ValidationsTasksPanel extends FramedPanel implements retrieveCurrentTR(); } - + + /** + * + * @param trId + * @param eventBus + */ public ValidationsTasksPanel(TRId trId, EventBus eventBus) { super(); Log.debug("ValidationsTasksPanel: " + trId); @@ -143,7 +153,6 @@ public class ValidationsTasksPanel extends FramedPanel implements protected void create() { con = new VerticalLayoutContainer(); con.setScrollMode(ScrollMode.AUTO); - store = new TreeStore(new KeyProvider()); @@ -169,8 +178,6 @@ public class ValidationsTasksPanel extends FramedPanel implements } }); - - ColumnConfig cc2 = new ColumnConfig( new ValueProvider() { @@ -199,15 +206,6 @@ public class ValidationsTasksPanel extends FramedPanel implements validationButton.setFalseIcon(ResourceBundle.INSTANCE.error()); validationButton.setTrueTitle("Valid"); validationButton.setFalseTitle("Error"); - /* - * validationButton.addSelectHandler(new SelectHandler() { - * - * @Override public void onSelect(SelectEvent event) { - * Log.debug("Button ValidationCell Pressed"); Context context = - * event.getContext(); requestSolution(context); - * - * } }); - */ cc2.setCell(validationButton); @@ -299,7 +297,7 @@ public class ValidationsTasksPanel extends FramedPanel implements con.add(tree, new VerticalLayoutData(1, -1)); add(con, new MarginData(0)); - + forceLayout(); } @@ -325,7 +323,7 @@ public class ValidationsTasksPanel extends FramedPanel implements } else { if (v.getInvocation() != null) { InvocationS invocationS = v.getInvocation(); - + Long op = invocationS.getOperationId(); if (op.compareTo(OperationsId.ChangeToDimensionColumn .toLong()) == 0) { @@ -418,7 +416,6 @@ public class ValidationsTasksPanel extends FramedPanel implements } }); - tree.setContextMenu(contextMenu); @@ -514,7 +511,7 @@ public class ValidationsTasksPanel extends FramedPanel implements public void update(TRId trId) { this.trId = trId; draw(); - + } protected void retrieveCurrentTR() { @@ -605,63 +602,71 @@ public class ValidationsTasksPanel extends FramedPanel implements eventBus.fireEvent(changeTableRequestEvent); } - - - -// @SuppressWarnings("rawtypes") -// protected AbstractCell actionButton = new AbstractCell() { -// -// @Override -// public void render(Context context, Boolean value, SafeHtmlBuilder sb) { -// -// if (value == null) { -// sb.appendHtmlConstant(""); -// } else { -// Log.debug("Context: pos=" + context.getIndex() + ", key=" -// + context.getKey() + ", column=" + context.getColumn()); -// String key = (String) context.getKey(); -// BaseDto d = store.findModelWithKey(key); -// -// /* -// * List list = ; -// * Log.debug("List: ["+list.toString()+"]"); int i = 0; BaseDto -// * d=null; for (; i < list.size(); i++) { BaseDto dt = -// * list.get(i); if (dt.getId().compareTo((String) -// * context.getKey()) == 0) { d=dt; -// * Log.debug("Retrieved: "+d+" at pos:"+i); break; } } -// */ -// -// String title = ""; -// if (d != null) { -// Log.debug(d.toString()); -// if (d instanceof ValidationDto) { -// ValidationDto v = (ValidationDto) d; -// Log.debug("ValidationDto: [" + v.getId() + ", " -// + v.getDescription() + ", " + v.getValid() -// + ", " + v.getInvocation() + "]"); -// if (v.getInvocation() != null) { -// title = v.getInvocation().toString(); -// } -// } -// } -// -// if (value) { -// -// sb.appendHtmlConstant("true"); -// -// } else { -// sb.appendHtmlConstant("false"); -// -// } -// } -// -// } -// }; - + + // @SuppressWarnings("rawtypes") + // protected AbstractCell actionButton = new AbstractCell() { + // + // @Override + // public void render(Context context, Boolean value, SafeHtmlBuilder sb) { + // + // if (value == null) { + // sb.appendHtmlConstant(""); + // } else { + // Log.debug("Context: pos=" + context.getIndex() + ", key=" + // + context.getKey() + ", column=" + context.getColumn()); + // String key = (String) context.getKey(); + // BaseDto d = store.findModelWithKey(key); + // + // /* + // * List list = ; + // * Log.debug("List: ["+list.toString()+"]"); int i = 0; BaseDto + // * d=null; for (; i < list.size(); i++) { BaseDto dt = + // * list.get(i); if (dt.getId().compareTo((String) + // * context.getKey()) == 0) { d=dt; + // * Log.debug("Retrieved: "+d+" at pos:"+i); break; } } + // */ + // + // String title = ""; + // if (d != null) { + // Log.debug(d.toString()); + // if (d instanceof ValidationDto) { + // ValidationDto v = (ValidationDto) d; + // Log.debug("ValidationDto: [" + v.getId() + ", " + // + v.getDescription() + ", " + v.getValid() + // + ", " + v.getInvocation() + "]"); + // if (v.getInvocation() != null) { + // title = v.getInvocation().toString(); + // } + // } + // } + // + // if (value) { + // + // sb.appendHtmlConstant("true"); + // + // } else { + // sb.appendHtmlConstant("false"); + // + // } + // } + // + // } + // }; + + /* + * validationButton.addSelectHandler(new SelectHandler() { + * + * @Override public void onSelect(SelectEvent event) { + * Log.debug("Button ValidationCell Pressed"); Context context = + * event.getContext(); requestSolution(context); + * + * } }); + */ + }