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 TreeDataGenerator gen;
protected TreeStore<BaseDto> store; protected TreeStore<BaseDto> store;
protected TreeGrid<BaseDto> tree; protected TreeGrid<BaseDto> tree;
class KeyProvider implements ModelKeyProvider<BaseDto> { class KeyProvider implements ModelKeyProvider<BaseDto> {
@Override @Override
public String getKey(BaseDto item) { public String getKey(BaseDto item) {
return (item instanceof FolderDto ? "f-" : "v-") + item.getId(); return (item instanceof FolderDto ? "f-" : "v-") + item.getId();
} }
} }
/**
*
* @param eventBus
*/
public ValidationsTasksPanel(EventBus eventBus) { public ValidationsTasksPanel(EventBus eventBus) {
super(); super();
Log.debug("ValidationsTasksPanel"); Log.debug("ValidationsTasksPanel");
@ -109,7 +114,12 @@ public class ValidationsTasksPanel extends FramedPanel implements
retrieveCurrentTR(); retrieveCurrentTR();
} }
/**
*
* @param trId
* @param eventBus
*/
public ValidationsTasksPanel(TRId trId, EventBus eventBus) { public ValidationsTasksPanel(TRId trId, EventBus eventBus) {
super(); super();
Log.debug("ValidationsTasksPanel: " + trId); Log.debug("ValidationsTasksPanel: " + trId);
@ -143,7 +153,6 @@ 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);
store = new TreeStore<BaseDto>(new KeyProvider()); store = new TreeStore<BaseDto>(new KeyProvider());
@ -169,8 +178,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
} }
}); });
ColumnConfig<BaseDto, Boolean> cc2 = new ColumnConfig<BaseDto, Boolean>( ColumnConfig<BaseDto, Boolean> cc2 = new ColumnConfig<BaseDto, Boolean>(
new ValueProvider<BaseDto, Boolean>() { new ValueProvider<BaseDto, Boolean>() {
@ -199,15 +206,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
validationButton.setFalseIcon(ResourceBundle.INSTANCE.error()); validationButton.setFalseIcon(ResourceBundle.INSTANCE.error());
validationButton.setTrueTitle("Valid"); validationButton.setTrueTitle("Valid");
validationButton.setFalseTitle("Error"); 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); cc2.setCell(validationButton);
@ -299,7 +297,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
con.add(tree, new VerticalLayoutData(1, -1)); con.add(tree, new VerticalLayoutData(1, -1));
add(con, new MarginData(0)); add(con, new MarginData(0));
forceLayout(); forceLayout();
} }
@ -325,7 +323,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
} else { } else {
if (v.getInvocation() != null) { if (v.getInvocation() != null) {
InvocationS invocationS = v.getInvocation(); InvocationS invocationS = v.getInvocation();
Long op = invocationS.getOperationId(); Long op = invocationS.getOperationId();
if (op.compareTo(OperationsId.ChangeToDimensionColumn if (op.compareTo(OperationsId.ChangeToDimensionColumn
.toLong()) == 0) { .toLong()) == 0) {
@ -418,7 +416,6 @@ public class ValidationsTasksPanel extends FramedPanel implements
} }
}); });
tree.setContextMenu(contextMenu); tree.setContextMenu(contextMenu);
@ -514,7 +511,7 @@ public class ValidationsTasksPanel extends FramedPanel implements
public void update(TRId trId) { public void update(TRId trId) {
this.trId = trId; this.trId = trId;
draw(); draw();
} }
protected void retrieveCurrentTR() { protected void retrieveCurrentTR() {
@ -605,63 +602,71 @@ public class ValidationsTasksPanel extends FramedPanel implements
eventBus.fireEvent(changeTableRequestEvent); eventBus.fireEvent(changeTableRequestEvent);
} }
// @SuppressWarnings("rawtypes")
// protected AbstractCell actionButton = new AbstractCell<Boolean>() {
// @SuppressWarnings("rawtypes") //
// protected AbstractCell actionButton = new AbstractCell<Boolean>() { // @Override
// // public void render(Context context, Boolean value, SafeHtmlBuilder sb) {
// @Override //
// public void render(Context context, Boolean value, SafeHtmlBuilder sb) { // if (value == null) {
// // sb.appendHtmlConstant("");
// if (value == null) { // } else {
// sb.appendHtmlConstant(""); // Log.debug("Context: pos=" + context.getIndex() + ", key="
// } else { // + context.getKey() + ", column=" + context.getColumn());
// Log.debug("Context: pos=" + context.getIndex() + ", key=" // String key = (String) context.getKey();
// + context.getKey() + ", column=" + context.getColumn()); // BaseDto d = store.findModelWithKey(key);
// String key = (String) context.getKey(); //
// BaseDto d = store.findModelWithKey(key); // /*
// // * List<BaseDto> list = ;
// /* // * Log.debug("List: ["+list.toString()+"]"); int i = 0; BaseDto
// * List<BaseDto> list = ; // * d=null; for (; i < list.size(); i++) { BaseDto dt =
// * Log.debug("List: ["+list.toString()+"]"); int i = 0; BaseDto // * list.get(i); if (dt.getId().compareTo((String)
// * d=null; for (; i < list.size(); i++) { BaseDto dt = // * context.getKey()) == 0) { d=dt;
// * list.get(i); if (dt.getId().compareTo((String) // * Log.debug("Retrieved: "+d+" at pos:"+i); break; } }
// * context.getKey()) == 0) { d=dt; // */
// * Log.debug("Retrieved: "+d+" at pos:"+i); break; } } //
// */ // String title = "";
// // if (d != null) {
// String title = ""; // Log.debug(d.toString());
// if (d != null) { // if (d instanceof ValidationDto) {
// Log.debug(d.toString()); // ValidationDto v = (ValidationDto) d;
// if (d instanceof ValidationDto) { // Log.debug("ValidationDto: [" + v.getId() + ", "
// ValidationDto v = (ValidationDto) d; // + v.getDescription() + ", " + v.getValid()
// Log.debug("ValidationDto: [" + v.getId() + ", " // + ", " + v.getInvocation() + "]");
// + v.getDescription() + ", " + v.getValid() // if (v.getInvocation() != null) {
// + ", " + v.getInvocation() + "]"); // title = v.getInvocation().toString();
// if (v.getInvocation() != null) { // }
// title = v.getInvocation().toString(); // }
// } // }
// } //
// } // if (value) {
// //
// if (value) { // sb.appendHtmlConstant("<img src='"
// // + ResourceBundle.INSTANCE.ok().getSafeUri()
// sb.appendHtmlConstant("<img src='" // .asString() + "' alt='true' title='"
// + ResourceBundle.INSTANCE.ok().getSafeUri() // + title + "'>");
// .asString() + "' alt='true' title='" //
// + title + "'>"); // } else {
// // sb.appendHtmlConstant("<img src='"
// } else { // + ResourceBundle.INSTANCE.exit().getSafeUri()
// sb.appendHtmlConstant("<img src='" // .asString() + "' alt='false' title='"
// + ResourceBundle.INSTANCE.exit().getSafeUri() // + title + "'>");
// .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);
*
* } });
*/
} }