Revision 8712
org.gvsig.report/trunk/org.gvsig.report/org.gvsig.report.swing/org.gvsig.report.swing.impl/src/main/java/org/gvsig/report/swing/impl/actions/JasperReportActionFactory.java | ||
---|---|---|
1 | 1 |
package org.gvsig.report.swing.impl.actions; |
2 | 2 |
|
3 |
import java.util.Collection; |
|
3 | 4 |
import javax.json.JsonObject; |
5 |
import org.apache.commons.collections.CollectionUtils; |
|
6 |
import org.apache.commons.collections4.MapUtils; |
|
4 | 7 |
import org.apache.commons.lang3.StringUtils; |
5 | 8 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
6 | 9 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
7 | 10 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
11 |
import org.gvsig.fmap.dal.swing.DALActionFactory; |
|
8 | 12 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
9 | 13 |
import org.gvsig.fmap.dal.swing.DataSwingManager; |
10 | 14 |
import org.gvsig.fmap.dal.swing.report.AbstractReportActionFactory; |
... | ... | |
38 | 42 |
|
39 | 43 |
@Override |
40 | 44 |
public boolean isApplicable(Object... args) { |
45 |
if(args[0] == null){ |
|
46 |
return false; |
|
47 |
} |
|
48 |
if(args[1] instanceof DALActionFactory.DALActionContext){ |
|
49 |
FeatureQuery query = ((DALActionFactory.DALActionContext)args[1]).getQuery(); |
|
50 |
if(query != null){ |
|
51 |
if(CollectionUtils.isNotEmpty((Collection) query.getGroupByColumns())){ |
|
52 |
return false; |
|
53 |
} |
|
54 |
if(MapUtils.isNotEmpty(query.getAggregateFunctions())){ |
|
55 |
return false; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
41 | 60 |
JsonObject json = (JsonObject) args[0]; |
42 | 61 |
String type = json.getString("type", "jasper").trim(); |
43 | 62 |
return StringUtils.equalsIgnoreCase(type, "jasper"); |
Also available in: Unified diff