Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@98733 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-17 09:51:18 +00:00 committed by Giancarlo Panichi
parent bcb3aa31da
commit 62754ee4c2
1 changed files with 83 additions and 78 deletions

View File

@ -92,14 +92,19 @@ public class ValidationsTasksPanel extends FramedPanel implements
protected TreeDataGenerator gen;
protected TreeStore<BaseDto> store;
protected TreeGrid<BaseDto> tree;
class KeyProvider implements ModelKeyProvider<BaseDto> {
@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<BaseDto>(new KeyProvider());
@ -169,8 +178,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
}
});
ColumnConfig<BaseDto, Boolean> cc2 = new ColumnConfig<BaseDto, Boolean>(
new ValueProvider<BaseDto, Boolean>() {
@ -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<Boolean>() {
//
// @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<BaseDto> 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("<img src='"
// + ResourceBundle.INSTANCE.ok().getSafeUri()
// .asString() + "' alt='true' title='"
// + title + "'>");
//
// } else {
// sb.appendHtmlConstant("<img src='"
// + ResourceBundle.INSTANCE.exit().getSafeUri()
// .asString() + "' alt='false' title='"
// + title + "'>");
//
// }
// }
//
// }
// };
// @SuppressWarnings("rawtypes")
// protected AbstractCell actionButton = new AbstractCell<Boolean>() {
//
// @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<BaseDto> 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("<img src='"
// + ResourceBundle.INSTANCE.ok().getSafeUri()
// .asString() + "' alt='true' title='"
// + title + "'>");
//
// } else {
// sb.appendHtmlConstant("<img src='"
// + ResourceBundle.INSTANCE.exit().getSafeUri()
// .asString() + "' alt='false' title='"
// + title + "'>");
//
// }
// }
//
// }
// };
/*
* validationButton.addSelectHandler(new SelectHandler() {
*
* @Override public void onSelect(SelectEvent event) {
* Log.debug("Button ValidationCell Pressed"); Context context =
* event.getContext(); requestSolution(context);
*
* } });
*/
}