Author: konstantin.mishin
Date: 2008-08-14 10:27:15 -0400 (Thu, 14 Aug 2008)
New Revision: 10096
Added:
trunk/framework/api/src/main/java/org/richfaces/model/Modifiable.java
Removed:
trunk/framework/impl/src/main/java/org/richfaces/model/AbstractModifiableModel.java
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
refactoring
Added: trunk/framework/api/src/main/java/org/richfaces/model/Modifiable.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/Modifiable.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/Modifiable.java 2008-08-14
14:27:15 UTC (rev 10096)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.util.List;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public interface Modifiable{
+
+ void modify(List<FilterField> filterFields, List<SortField2> sortFields);
+}
Deleted:
trunk/framework/impl/src/main/java/org/richfaces/model/AbstractModifiableModel.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/model/AbstractModifiableModel.java 2008-08-14
14:06:43 UTC (rev 10095)
+++
trunk/framework/impl/src/main/java/org/richfaces/model/AbstractModifiableModel.java 2008-08-14
14:27:15 UTC (rev 10096)
@@ -1,17 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.util.List;
-
-import org.ajax4jsf.model.ExtendedDataModel;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public abstract class AbstractModifiableModel extends ExtendedDataModel{
-
- public abstract void modify(List<FilterField> filterFields,
List<SortField2> sortFields);
-}
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-08-14
14:06:43 UTC (rev 10095)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-08-14
14:27:15 UTC (rev 10096)
@@ -28,7 +28,7 @@
* @author Konstantin Mishin
*
*/
-public class ModifiableModel extends AbstractModifiableModel{
+public class ModifiableModel extends ExtendedDataModel implements Modifiable{
private class RowKeyWrapperFactory extends ObjectWrapperFactory {
@@ -176,7 +176,6 @@
}
- @Override
public void modify(List<FilterField> filterFields, List<SortField2>
sortFields) {
int rowCount = originalModel.getRowCount();
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-08-14
14:06:43 UTC (rev 10095)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-08-14
14:27:15 UTC (rev 10096)
@@ -38,7 +38,7 @@
import org.ajax4jsf.component.SequenceDataAdaptor;
import org.ajax4jsf.model.ExtendedDataModel;
-import org.richfaces.model.AbstractModifiableModel;
+import org.richfaces.model.Modifiable;
import org.richfaces.model.FilterField;
import org.richfaces.model.ModifiableModel;
import org.richfaces.model.SortField2;
@@ -122,14 +122,15 @@
ExtendedDataModel dataModel = super.createDataModel();
if ((filterFields != null && !filterFields.isEmpty())
|| (sortFields != null && !sortFields.isEmpty())) {
- AbstractModifiableModel modifiableModel = null;
- if (dataModel instanceof AbstractModifiableModel) {
- modifiableModel = (AbstractModifiableModel) dataModel;
+ Modifiable modifiable = null;
+ if (dataModel instanceof Modifiable) {
+ modifiable = (Modifiable) dataModel;
} else {
- modifiableModel = new ModifiableModel(dataModel, getVar());
+ ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
+ dataModel = modifiableModel;
+ modifiable = modifiableModel;
}
- modifiableModel.modify(filterFields, sortFields);
- dataModel = modifiableModel;
+ modifiable.modify(filterFields, sortFields);
}
return dataModel;
}
Show replies by date