org.apache.commons.lang3.builder.Builder Java Examples

The following examples show how to use org.apache.commons.lang3.builder.Builder. 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: BaseTaskExecutionModule.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
protected final void initModuleSettingsPanel(VBox panel) {
    panel.getStyleClass().addAll(Style.DEAULT_CONTAINER.css());
    panel.getStyleClass().addAll(Style.MODULE_CONTAINER.css());
    panel.getChildren().add(footer);

    footer.runButton().setOnAction(event -> {
        ErrorTracker errorTracker = new ErrorTracker();
        Builder<? extends AbstractParameters> builder = getBuilder(errorTracker
                .andThen(s -> eventStudio().broadcast(new AddNotificationRequestEvent(NotificationType.ERROR, s,
                        DefaultI18nContext.getInstance().i18n("Invalid parameters")))));
        if (!errorTracker.errorOnBuild) {
            eventStudio().broadcast(new TaskExecutionRequestEvent(id(), builder.build()));
        }
    });
    modulePanel.setCenter(panel);
    eventStudio().addAnnotatedListeners(this);
}
 
Example #2
Source File: SplitBySizeModule.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Builder<SplitBySizeParameters> getBuilder(Consumer<String> onError) {
    SplitBySizeParametersBuilder builder = new SplitBySizeParametersBuilder();
    splitOptions.apply(builder, onError);
    selectionPane.apply(builder, onError);
    destinationDirectoryField.apply(builder, onError);
    destinationPane.apply(builder, onError);
    prefix.apply(builder, onError);
    return builder;
}
 
Example #3
Source File: SplitByBookmarksModule.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Builder<SplitByOutlineLevelParameters> getBuilder(Consumer<String> onError) {
    SplitByOutlineLevelParametersBuilder builder = new SplitByOutlineLevelParametersBuilder();
    splitOptions.apply(builder, onError);
    selectionPane.apply(builder, onError);
    destinationDirectoryField.apply(builder, onError);
    destinationPane.apply(builder, onError);
    prefix.apply(builder, onError);
    return builder;
}
 
Example #4
Source File: SplitModule.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected Builder<? extends AbstractSplitByPageParameters> getBuilder(Consumer<String> onError) {
    Optional<SinglePdfSourceMultipleOutputParametersBuilder<? extends AbstractSplitByPageParameters>> builder = Optional
            .ofNullable(splitOptions.getBuilder(onError));
    builder.ifPresent(b -> {
        selectionPane.apply(b, onError);
        destinationDirectoryField.apply(b, onError);
        destinationPane.apply(b, onError);
        prefix.apply(b, onError);
    });
    return builder.orElse(null);
}
 
Example #5
Source File: BaseTaskExecutionModule.java    From pdfsam with GNU Affero General Public License v3.0 2 votes vote down vote up
/**
 * @param onError
 *            function to be called in case of error while building the task parameters
 * @return a {@link Builder} for the parameters to be used to perform a pdf manipulation
 */
protected abstract Builder<? extends AbstractParameters> getBuilder(Consumer<String> onError);