本文整理汇总了Java中net.sf.jasperreports.engine.design.JRValidationFault.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java JRValidationFault.getMessage方法的具体用法?Java JRValidationFault.getMessage怎么用?Java JRValidationFault.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.design.JRValidationFault
的用法示例。
在下文中一共展示了JRValidationFault.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValidationMarkers
import net.sf.jasperreports.engine.design.JRValidationFault; //导入方法依赖的package包/类
protected void setValidationMarkers(JRValidationException e, JasperDesign design) {
for (JRValidationFault fault : e.getFaults()) {
String message = fault.getMessage();
SourceLocation location = null;
Object source = fault.getSource();
if (source != null) {
location = digester.getLocation(source);
if (location == null)
message = message + " --- " + source.toString(); //$NON-NLS-1$
}
if (source instanceof StandardTable){
JRDesignElement componentElement = getElementFromTable(design.getAllBands(), (StandardTable)source);
if (componentElement != null) source = componentElement;
}
if (location == null && source instanceof JRDesignElement) errorHandler.addMarker(message, location, (JRDesignElement)source);
else errorHandler.addMarker(message, location);
}
}
示例2: ProblemItem
import net.sf.jasperreports.engine.design.JRValidationFault; //导入方法依赖的package包/类
/** Creates a new instance of ProblemItem */
public ProblemItem(int problemType, JRValidationFault fault) {
this.fault = fault;
this.problemType = problemType;
if (fault != null)
{
this.description = fault.getMessage();
}
}
示例3: verifyDesign
import net.sf.jasperreports.engine.design.JRValidationFault; //导入方法依赖的package包/类
public void verifyDesign()
{
// Remove all the WARNINGS...
for (int i=0; i<getJrxmlVisualView().getReportProblems().size(); ++i)
{
ProblemItem pii = getJrxmlVisualView().getReportProblems().get(i);
if (pii.getProblemType() == ProblemItem.WARNING ||
pii.getProblemType() == ProblemItem.INFORMATION)
{
getJrxmlVisualView().getReportProblems().remove(i);
i--;
}
}
//getJReportFrame().getReportProblems().clear();
try {
//SourceTraceDigester digester = IReportCompiler.createDigester();
//ReportWriter rw = new ReportWriter(getJReportFrame().getReport());
//ByteArrayOutputStream baos = new ByteArrayOutputStream();
//rw.writeToOutputStream(baos);
//JasperDesign jd = IReportCompiler.loadJasperDesign( new ByteArrayInputStream( baos.toByteArray() ), digester);
// set the correct class loader
Thread.currentThread().setContextClassLoader( IReportManager.getReportClassLoader());
if (getJrxmlVisualView().getModel() != null &&
getJrxmlVisualView().getModel().getJasperDesign() != null)
{
JasperDesign design = getJrxmlVisualView().getModel().getJasperDesign();
Collection ls = JasperCompileManager.verifyDesign(design);
Iterator iterator = ls.iterator();
while (iterator.hasNext())
{
JRValidationFault fault = (JRValidationFault)iterator.next();
String s = fault.getMessage();
//SourceLocation sl = digester.getLocation( fault.getSource() );
getJrxmlVisualView().getReportProblems().add( new ProblemItem(ProblemItem.WARNING, fault));
}
}
} catch (Exception ex)
{
ex.printStackTrace();
getJrxmlVisualView().getReportProblems().add(new ProblemItem(ProblemItem.WARNING, ex.getMessage(), null, null) );
}
Runnable runner = new Runnable(){
public void run()
{
//MainFrame.getMainInstance().getLogPane().getProblemsPanel().update();
ErrorHandlerTopComponent.getDefault().refreshErrors();
}
};
SwingUtilities.invokeLater(runner);
}