public CategoryDefinitionProvider put(final String categoryId, final Consumer<CategoryDefinition> definitionConsumer) { if (definitions.containsKey(categoryId)) { throw new IllegalArgumentException("Setting the definition for an already existing palette category. " + "[category=" + categoryId + "]"); } CategoryDefinition definition = new CategoryDefinition(categoryId); definitions.put(categoryId, definition); definitionConsumer.accept(definition); return this; }
this.put(BPMNCategories.START_EVENTS, category -> category .bindToDefinition(StartNoneEvent.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryStartEvents().getSafeUri()))) .put(BPMNCategories.INTERMEDIATE_EVENTS, category -> category .bindToDefinition(IntermediateTimerEvent.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryIntermediateEvents().getSafeUri()))) .put(BPMNCategories.END_EVENTS, category -> category .bindToDefinition(EndNoneEvent.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryEndEvents().getSafeUri()))) .put(BPMNCategories.ACTIVITIES, category -> category .bindToDefinition(NoneTask.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryActivity().getSafeUri()))) .put(BPMNCategories.SUB_PROCESSES, category -> category .bindToDefinition(ReusableSubprocess.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categorySubProcess().getSafeUri()))) .put(BPMNCategories.GATEWAYS, category -> category .bindToDefinition(ParallelGateway.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryGateway().getSafeUri()))) .put(BPMNCategories.CONTAINERS, category -> category .bindToDefinition(Lane.class) .useGlyph(SvgDataUriGlyph.Builder.build(BPMNImageResources.INSTANCE.categoryContainer().getSafeUri()))) .put(BPMNCategories.CONNECTING_OBJECTS,