Java Code Examples for org.eclipse.emf.ecore.resource.URIConverter#INSTANCE

The following examples show how to use org.eclipse.emf.ecore.resource.URIConverter#INSTANCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserContentManagerTests.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Test With No Exist Last Destination File.
 * 
 * @throws IOException
 *             IOException
 * @throws DocumentParserException
 *             DocumentParserException
 */
@Test
public void testWithNoExistLastDestinationFile() throws IOException, DocumentParserException {
    UserContentManager userContentManager = new UserContentManager(URIConverter.INSTANCE, null,
            URI.createFileURI("no_exist_file_path"));

    assertNull(userContentManager.consumeUserContent("noExistid1"));

}
 
Example 2
Source File: UserContentManagerTests.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Test With Last Destination File Contain No UserContent.
 * 
 * @throws IOException
 *             IOException
 * @throws DocumentParserException
 *             DocumentParserException
 */
@Test
public void testLastDestinationFileContainNoUserContent() throws IOException, DocumentParserException {
    UserContentManager userContentManager = new UserContentManager(URIConverter.INSTANCE, null,
            URI.createFileURI("userContent/testUserContent2.docx"));
    // CHECKSTYLE:OFF
    assertNull(userContentManager.consumeUserContent("noExistid2"));
    // CHECKSTYLE:ON
    userContentManager.dispose();
}
 
Example 3
Source File: MListTestServices.java    From M2Doc with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @return
 */
private static MList initSampleMElements() {
    final MList res = new MListImpl();

    final MBookmark bookmark = new MBookmarkImpl("bookmark", "id", false);
    res.add(bookmark);
    res.add(MPagination.newParagraph);

    final MText text = new MTextImpl("some text",
            new MStyleImpl(null, 12, Color.ORANGE, null, MStyle.FONT_BOLD | MStyle.FONT_ITALIC));
    res.add(text);
    res.add(MPagination.newParagraph);

    final MBookmark bookmarkRef = new MBookmarkImpl("bookmarkRef", "id", true);
    res.add(bookmarkRef);
    res.add(MPagination.newParagraph);

    final MText text1 = new MTextImpl("some text1",
            new MStyleImpl(null, 12, Color.ORANGE, null, MStyle.FONT_BOLD | MStyle.FONT_ITALIC));
    res.add(text1);
    res.add(MPagination.newParagraph);

    final MImage image = new MImageImpl(URIConverter.INSTANCE,
            URI.createURI("resources/mList/sampleMList/dh1.gif"));
    image.setHeight(200);
    res.add(image);
    res.add(MPagination.newParagraph);

    final MText text2 = new MTextImpl("some text2",
            new MStyleImpl(null, 12, Color.ORANGE, null, MStyle.FONT_BOLD | MStyle.FONT_ITALIC));
    res.add(text2);

    final MTable table = new MTableTestServices().sampleTable("sample table");
    res.add(table);
    res.add(MPagination.newParagraph);

    final MText text3 = new MTextImpl("some text3",
            new MStyleImpl(null, 12, Color.ORANGE, null, MStyle.FONT_BOLD | MStyle.FONT_ITALIC));
    res.add(text3);
    res.add(MPagination.newParagraph);

    final MList list = new MListImpl();
    final MText textInList = new MTextImpl("text in a list",
            new MStyleImpl(null, 12, Color.GREEN, null, MStyle.FONT_BOLD));
    list.add(textInList);
    res.add(list);

    return res;
}