task_21363 #1

Closed
francesco.mangiacrapa wants to merge 53 commits from task_21363 into master
3 changed files with 24 additions and 48 deletions
Showing only changes of commit 8f8c1c3e5d - Show all commits

View File

@ -3,7 +3,7 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -99,10 +99,6 @@ public class CkanContentModeratorWidget {
}
public ItemsTable<CatalogueDataset> getItemsTable() {
return itemsTable;
}
public ScrollPanel getPanel(){
return cmsPanel;
}

View File

@ -148,7 +148,12 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
public String getValue(T object) {
if (object == null)
return "";
return ((CatalogueDataset) object).getType();
String type = ((CatalogueDataset) object).getType();
if (type == null)
return "";
return type;
}
// ADDING TOOLTIP
@ -156,13 +161,16 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
if (object == null)
return;
sb.appendHtmlConstant("<div title=\"" + ((CatalogueDataset) object).getType() + "\">");
String type = ((CatalogueDataset) object).getType();
if (type == null)
type = "";
sb.appendHtmlConstant("<div title=\"" + type + "\">");
super.render(context, object, sb);
sb.appendHtmlConstant("</div>");
};
};
sortedCellTable.addColumn(name, "Type", true);
sortedCellTable.addColumn(type, "Type", true);
if (!isAsyncronusTable) {
Comparator<T> c = new Comparator<T>() {
@ -177,41 +185,6 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
}
// if (this.displayFields.contains(DISPLAY_FIELD.ICON)) {
// // ICONS
// ImageResourceCell iconResourceCell = new ImageResourceCell() {
// public Set<String> getConsumedEvents() {
// HashSet<String> events = new HashSet<String>();
// events.add("click");
// return events;
// }
// };
//
// icon = new Column<T, ImageResource>(iconResourceCell) {
// @Override
// public ImageResource getValue(T dataObj) {
// return Util.getImage(dataObj);
// }
//
// /*
// * (non-Javadoc)
// *
// * @see
// * com.google.gwt.user.cellview.client.Column#render(com.google.gwt.cell.client.
// * Cell.Context, java.lang.Object,
// * com.google.gwt.safehtml.shared.SafeHtmlBuilder)
// */
// @Override
// public void render(Context context, T object, SafeHtmlBuilder sb) {
// super.render(context, object, sb);
//
// }
// };
//// icon.setSortable(false);
// sortedCellTable.addColumn(icon, "", false);
// sortedCellTable.setColumnWidth(icon, 32.0, Unit.PX);
// }
if (this.displayFields.contains(DISPLAY_FIELD.NAME)) {
// NAME
@ -286,7 +259,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
}
};
sortedCellTable.addColumn(author, "Title", true);
sortedCellTable.addColumn(author, "Author", true);
if (!isAsyncronusTable) {
Comparator<T> c = new Comparator<T>() {
@ -300,7 +273,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
}
if (this.displayFields.contains(DISPLAY_FIELD.AUTHOR)) {
if (this.displayFields.contains(DISPLAY_FIELD.CREATED)) {
DateCell date = new DateCell(dtformat);
dateColumn = new Column<T, Date>(date) {
@ -342,6 +315,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
}
GWT.log("startSortByColumn: " + startSortByColumn);
if (startSortByColumn != null)
@ -358,6 +332,11 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
break;
case AUTHOR:
if (this.displayFields.contains(DISPLAY_FIELD.AUTHOR)) {
sortedCellTable.setInitialSortColumn(author);
}
break;
case CREATED:
if (this.displayFields.contains(DISPLAY_FIELD.CREATED)) {
sortedCellTable.setDefaultSortOrder(dateColumn, false); // sorts ascending on first click
sortedCellTable.setInitialSortColumn(dateColumn);
GWT.log("sortedCellTable: " + sortedCellTable);
@ -367,6 +346,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
break;
}
/*
* final SingleSelectionModel<Item> selectionModel = new
* SingleSelectionModel<Item>(); selectionModel.addSelectionChangeHandler(new