当前位置: 首页>>代码示例>>Java>>正文


Java SimpleSplitParameters类代码示例

本文整理汇总了Java中org.sejda.model.parameter.SimpleSplitParameters的典型用法代码示例。如果您正苦于以下问题:Java SimpleSplitParameters类的具体用法?Java SimpleSplitParameters怎么用?Java SimpleSplitParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SimpleSplitParameters类属于org.sejda.model.parameter包,在下文中一共展示了SimpleSplitParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: builderDisabledOptimization

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void builderDisabledOptimization() throws Exception {
    SplitAfterPredefinedSetOfPagesRadioButton victim = find("#victim");
    click("#combo").click("Odd pages");
    final File file = folder.newFile("my.pdf");
    FXTestUtils.invokeAndWait(() -> {
        SimpleSplitParametersBuilder builder = victim.getBuilder(onError);
        builder.compress(true);
        FileOrDirectoryTaskOutput output = mock(FileOrDirectoryTaskOutput.class);
        builder.output(output);
        builder.existingOutput(ExistingOutputPolicy.OVERWRITE);
        builder.prefix("prefix");
        PdfFileSource source = PdfFileSource.newInstanceNoPassword(file);
        builder.source(source);
        builder.version(PdfVersion.VERSION_1_7);
        System.setProperty(SplitParametersBuilder.PDFSAM_DISABLE_SPLIT_OPTIMIZATION, Boolean.TRUE.toString());
        SimpleSplitParameters params = builder.build();
        assertEquals(OptimizationPolicy.NO, params.getOptimizationPolicy());
        verify(onError, never()).accept(anyString());
    }, 2);
    System.setProperty(SplitParametersBuilder.PDFSAM_DISABLE_SPLIT_OPTIMIZATION, Boolean.FALSE.toString());
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:23,代码来源:SplitAfterPredefinedSetOfPagesRadioButtonTest.java

示例2: directoryIsEmpty

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void directoryIsEmpty() {
    SimpleSplitParameters parameters = new SimpleSplitParameters(PredefinedSetOfPages.ALL_PAGES);
    parameters.setExistingOutputPolicy(ExistingOutputPolicy.FAIL);
    FileOrDirectoryTaskOutput output = mock(FileOrDirectoryTaskOutput.class);
    File file = mock(File.class);
    when(file.listFiles()).thenReturn(new File[0]);
    when(output.getDestination()).thenReturn(file);
    parameters.setOutput(output);
    injector.instance(OverwriteDialogController.class).request(new TaskExecutionRequestEvent("id", parameters));
    OverwriteConfirmationDialog dialog = injector.instance(OverwriteConfirmationDialog.class);
    verify(dialog, never()).title(anyString());
    verify(dialog, never()).messageContent(anyString());
    verify(dialog, never()).messageTitle(anyString());
    verify(dialog, never()).response();
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:17,代码来源:OverwriteDialogControllerTest.java

示例3: setUpParameters

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
/**
 * Set up of the set page labels parameters
 * 
 */
private void setUpParameters(PredefinedSetOfPages type) {
    parameters = new SimpleSplitParameters(type);
    parameters.setCompress(true);
    parameters.setVersion(PdfVersion.VERSION_1_6);
    parameters.setSource(getSource());
    parameters.setOverwrite(true);
    parameters.setOutput(getOutput());
}
 
开发者ID:torakiki,项目名称:sejda-itext5,代码行数:13,代码来源:SimpleSplitIText5TaskTest.java

示例4: build

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Override
public SimpleSplitParameters build() {
    SimpleSplitParameters params = new SimpleSplitParameters(pages);
    params.setCompress(isCompress());
    params.setExistingOutputPolicy(existingOutput());
    params.setVersion(getVersion());
    params.setOutput(getOutput());
    params.setOutputPrefix(getPrefix());
    params.addSource(getSource());
    params.setOptimizationPolicy(getOptimizationPolicy());
    params.discardOutline(isDiscardBookmarks());
    return params;
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:14,代码来源:SplitAfterPredefinedSetOfPagesRadioButton.java

示例5: cancelOnNotEmptyDir

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void cancelOnNotEmptyDir() throws IOException {
    SimpleSplitParameters parameters = new SimpleSplitParameters(PredefinedSetOfPages.ALL_PAGES);
    parameters.setExistingOutputPolicy(ExistingOutputPolicy.FAIL);
    folder.newFile();
    parameters.setOutput(FileOrDirectoryTaskOutput.directory(folder.getRoot()));
    Button button = find("show");
    button.setOnAction(a -> eventStudio().broadcast(new TaskExecutionRequestEvent("id", parameters)));
    click("show");
    click(DefaultI18nContext.getInstance().i18n("Cancel"));
    assertEquals(ExistingOutputPolicy.FAIL, parameters.getExistingOutputPolicy());
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:13,代码来源:OverwriteDialogControllerUITest.java

示例6: overwriteOnNotEmptyDir

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void overwriteOnNotEmptyDir() throws IOException {
    SimpleSplitParameters parameters = new SimpleSplitParameters(PredefinedSetOfPages.ALL_PAGES);
    parameters.setExistingOutputPolicy(ExistingOutputPolicy.FAIL);
    folder.newFile();
    parameters.setOutput(FileOrDirectoryTaskOutput.directory(folder.getRoot()));
    Button button = find("show");
    button.setOnAction(a -> eventStudio().broadcast(new TaskExecutionRequestEvent("id", parameters)));
    click("show");
    click(DefaultI18nContext.getInstance().i18n("Overwrite"));
    assertEquals(ExistingOutputPolicy.OVERWRITE, parameters.getExistingOutputPolicy());
}
 
开发者ID:torakiki,项目名称:pdfsam,代码行数:13,代码来源:OverwriteDialogControllerUITest.java

示例7: toTaskParameters

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
/**
 * Transforms {@link SimpleSplitTaskCliArguments} to {@link SimpleSplitParameters}
 * 
 * @param taskCliArguments
 * @return populated task parameters
 */
@Override
public SimpleSplitParameters toTaskParameters(SimpleSplitTaskCliArguments taskCliArguments) {
    SimpleSplitParameters parameters = new SimpleSplitParameters(taskCliArguments.getPredefinedPages()
            .getEnumValue());

    populateAbstractParameters(parameters, taskCliArguments);
    populateSourceParameters(parameters, taskCliArguments);
    populateOutputTaskParameters(parameters, taskCliArguments);
    populateOutputPrefix(parameters, taskCliArguments);
    populateOptimizableOutputParameters(parameters, taskCliArguments);
    populateDiscardableOutlineParameters(parameters, taskCliArguments);

    return parameters;
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:21,代码来源:SimpleSplitCliArgumentsTransformer.java

示例8: setUpParameters

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
private void setUpParameters(PredefinedSetOfPages type) {
    parameters = new SimpleSplitParameters(type);
    parameters.setCompress(true);
    parameters.setVersion(PdfVersion.VERSION_1_6);
    parameters.addSource(shortInput());
    parameters.setExistingOutputPolicy(ExistingOutputPolicy.OVERWRITE);
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:8,代码来源:SimpleSplitTaskTest.java

示例9: predefinedPages_ALL_PAGES

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void predefinedPages_ALL_PAGES() {
    SimpleSplitParameters parameters = defaultCommandLine().with("-s", "all").invokeSejdaConsole();
    assertContainsAll(Arrays.asList(1, 2, 3, 4, 5), parameters.getPages(5));
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例10: predefinedPages_ODD_PAGES

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void predefinedPages_ODD_PAGES() {
    SimpleSplitParameters parameters = defaultCommandLine().with("-s", "odd").invokeSejdaConsole();
    assertContainsAll(Arrays.asList(1, 3, 5), parameters.getPages(5));
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例11: predefinedPages_EVEN_PAGES

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void predefinedPages_EVEN_PAGES() {
    SimpleSplitParameters parameters = defaultCommandLine().with("-s", "even").invokeSejdaConsole();
    assertContainsAll(Arrays.asList(2, 4), parameters.getPages(5));
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例12: optimizedNo

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void optimizedNo() {
    SimpleSplitParameters parameters = defaultCommandLine().with("-z", "no").invokeSejdaConsole();
    assertEquals(OptimizationPolicy.NO, parameters.getOptimizationPolicy());
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例13: discardOutline

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void discardOutline() {
    SimpleSplitParameters parameters = defaultCommandLine().withFlag("--discardOutline").invokeSejdaConsole();
    assertTrue(parameters.discardOutline());
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例14: dontDiscardOutline

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void dontDiscardOutline() {
    SimpleSplitParameters parameters = defaultCommandLine().invokeSejdaConsole();
    assertFalse(parameters.discardOutline());
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:6,代码来源:SimpleSplitTaskTest.java

示例15: getTask

import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Override
public Task<SimpleSplitParameters> getTask() {
    return new SplitByPageNumbersTask<SimpleSplitParameters>();
}
 
开发者ID:torakiki,项目名称:sejda,代码行数:5,代码来源:SimpleSplitSamboxTaskTest.java


注:本文中的org.sejda.model.parameter.SimpleSplitParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。