Search in sources :

Example 1 with NullInputStream

use of org.eclipse.jst.jsp.core.tests.NullInputStream in project webtools.sourceediting by eclipse.

the class JSPedCSSSourceParserTest method createModel.

private ICSSModel createModel(boolean isFragment) {
    IStructuredModel model = null;
    try {
        IModelManager modelManager = StructuredModelManager.getModelManager();
        model = // $NON-NLS-1$
        !isFragment ? // $NON-NLS-1$
        modelManager.getModelForEdit("cssjsptest" + index_jsp++ + ".jsp", new NullInputStream(), null) : // $NON-NLS-1$
        modelManager.getModelForEdit("cssjsptest" + index_jspf++ + ".jspf", new NullInputStream(), null);
        // $NON-NLS-1$
        model.getStructuredDocument().setLineDelimiter(commonEOL);
    } catch (Exception e) {
        StringWriter s = new StringWriter();
        e.printStackTrace(new PrintWriter(s));
        fail(s.toString());
    }
    return (ICSSModel) model;
}
Also used : StringWriter(java.io.StringWriter) ICSSModel(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel) IModelManager(org.eclipse.wst.sse.core.internal.provisional.IModelManager) IStructuredModel(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) NullInputStream(org.eclipse.jst.jsp.core.tests.NullInputStream) PrintWriter(java.io.PrintWriter)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 NullInputStream (org.eclipse.jst.jsp.core.tests.NullInputStream)1 ICSSModel (org.eclipse.wst.css.core.internal.provisional.document.ICSSModel)1 IModelManager (org.eclipse.wst.sse.core.internal.provisional.IModelManager)1 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)1