task_21363 #1
|
@ -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.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
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.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=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.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
|
|
|
@ -98,11 +98,7 @@ public class CkanContentModeratorWidget {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemsTable<CatalogueDataset> getItemsTable() {
|
|
||||||
return itemsTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ScrollPanel getPanel(){
|
public ScrollPanel getPanel(){
|
||||||
return cmsPanel;
|
return cmsPanel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
this.dataProvider = dataProvider;
|
this.dataProvider = dataProvider;
|
||||||
initAbstractTable(eventBus, fireEventOnClick, dataProvider, ContentModeratorWidgetConstants.ITEMS_PER_PAGE);
|
initAbstractTable(eventBus, fireEventOnClick, dataProvider, ContentModeratorWidgetConstants.ITEMS_PER_PAGE);
|
||||||
this.dataProvider.addDataDisplay(sortedCellTable);
|
this.dataProvider.addDataDisplay(sortedCellTable);
|
||||||
|
|
||||||
// this.isAsyncronusTable = dataProvider instanceof
|
// this.isAsyncronusTable = dataProvider instanceof
|
||||||
// AbstractDataProvider?true:false;
|
// AbstractDataProvider?true:false;
|
||||||
this.isAsyncronusTable = dataProvider instanceof ListDataProvider ? false : true;
|
this.isAsyncronusTable = dataProvider instanceof ListDataProvider ? false : true;
|
||||||
|
@ -148,7 +148,12 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
public String getValue(T object) {
|
public String getValue(T object) {
|
||||||
if (object == null)
|
if (object == null)
|
||||||
return "";
|
return "";
|
||||||
return ((CatalogueDataset) object).getType();
|
|
||||||
|
String type = ((CatalogueDataset) object).getType();
|
||||||
|
|
||||||
|
if (type == null)
|
||||||
|
return "";
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ADDING TOOLTIP
|
// 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) {
|
public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
|
||||||
if (object == null)
|
if (object == null)
|
||||||
return;
|
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);
|
super.render(context, object, sb);
|
||||||
sb.appendHtmlConstant("</div>");
|
sb.appendHtmlConstant("</div>");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sortedCellTable.addColumn(name, "Type", true);
|
sortedCellTable.addColumn(type, "Type", true);
|
||||||
|
|
||||||
if (!isAsyncronusTable) {
|
if (!isAsyncronusTable) {
|
||||||
Comparator<T> c = new Comparator<T>() {
|
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)) {
|
if (this.displayFields.contains(DISPLAY_FIELD.NAME)) {
|
||||||
|
|
||||||
// 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) {
|
if (!isAsyncronusTable) {
|
||||||
Comparator<T> c = new Comparator<T>() {
|
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);
|
DateCell date = new DateCell(dtformat);
|
||||||
dateColumn = new Column<T, Date>(date) {
|
dateColumn = new Column<T, Date>(date) {
|
||||||
|
@ -341,6 +314,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GWT.log("startSortByColumn: " + startSortByColumn);
|
GWT.log("startSortByColumn: " + startSortByColumn);
|
||||||
|
|
||||||
|
@ -358,6 +332,11 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
break;
|
break;
|
||||||
case AUTHOR:
|
case AUTHOR:
|
||||||
if (this.displayFields.contains(DISPLAY_FIELD.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.setDefaultSortOrder(dateColumn, false); // sorts ascending on first click
|
||||||
sortedCellTable.setInitialSortColumn(dateColumn);
|
sortedCellTable.setInitialSortColumn(dateColumn);
|
||||||
GWT.log("sortedCellTable: " + sortedCellTable);
|
GWT.log("sortedCellTable: " + sortedCellTable);
|
||||||
|
@ -366,6 +345,7 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* final SingleSelectionModel<Item> selectionModel = new
|
* final SingleSelectionModel<Item> selectionModel = new
|
||||||
|
|
Loading…
Reference in New Issue