本文整理汇总了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());
}
示例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();
}
示例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());
}
示例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;
}
示例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());
}
示例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());
}
示例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;
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}
示例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());
}
示例13: discardOutline
import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void discardOutline() {
SimpleSplitParameters parameters = defaultCommandLine().withFlag("--discardOutline").invokeSejdaConsole();
assertTrue(parameters.discardOutline());
}
示例14: dontDiscardOutline
import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Test
public void dontDiscardOutline() {
SimpleSplitParameters parameters = defaultCommandLine().invokeSejdaConsole();
assertFalse(parameters.discardOutline());
}
示例15: getTask
import org.sejda.model.parameter.SimpleSplitParameters; //导入依赖的package包/类
@Override
public Task<SimpleSplitParameters> getTask() {
return new SplitByPageNumbersTask<SimpleSplitParameters>();
}