Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: Please report issues related to Cron Expression Editor Add-on here.
description: Please report issues related to Cron Expression Field Add-on here.
body:
- type: textarea
id: problem-description
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Feature Request
description: Please add feature suggestions related to Cron Expression Editor Add-on here.
description: Please add feature suggestions related to Cron Expression Field Add-on here.
body:
- type: textarea
id: feature-proposal
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/cron-expression-editor-add-on)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/cron-expression-editor-add-on.svg)](https://vaadin.com/directory/component/cron-expression-editor-add-on)
[![Build Status](https://jenkins.flowingcode.com/job/CronExpressionEditor-addon/badge/icon)](https://jenkins.flowingcode.com/job/CronExpressionEditor-addon)
[![Maven Central](https://img.shields.io/maven-central/v/com.flowingcode.vaadin.addons/cron-expression-editor-addon)](https://mvnrepository.com/artifact/com.flowingcode.vaadin.addons/cron-expression-editor-addon)
[![Javadoc](https://img.shields.io/badge/javadoc-00b4f0)](https://javadoc.flowingcode.com/artifact/com.flowingcode.vaadin.addons/cron-expression-editor-addon)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/cron-expression-field-add-on)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/cron-expression-field-add-on.svg)](https://vaadin.com/directory/component/cron-expression-field-add-on)
[![Build Status](https://jenkins.flowingcode.com/job/CronExpressionField-addon/badge/icon)](https://jenkins.flowingcode.com/job/CronExpressionField-addon)
[![Maven Central](https://img.shields.io/maven-central/v/com.flowingcode.vaadin.addons/cron-expression-field-addon)](https://mvnrepository.com/artifact/com.flowingcode.vaadin.addons/cron-expression-field-addon)
[![Javadoc](https://img.shields.io/badge/javadoc-00b4f0)](https://javadoc.flowingcode.com/artifact/com.flowingcode.vaadin.addons/cron-expression-field-addon)

# Cron Expression Editor Add-on
# Cron Expression Field Add-on

A component for Vaadin 24 that assists in the generation of cron expressions
A component for Vaadin 24 that assists in the generation of cron expressions.

## Features

* A mode to input daily, weekly and monthly expressions with the assistance of UI components
* An advanced mode to input cron expressions directly
* Calculation of the next dates scheduled by the generated cron expression
* Allows the configuration of a list of frequently used cron expressions
* A mode to input daily, weekly and monthly expressions with the assistance of UI components.
* An advanced mode to input cron expressions directly.
* Calculation of the next dates scheduled by the generated cron expression.
* Allows the configuration of a list of frequently used cron expressions.

## Online demo

[Online demo here](http://addonsv24.flowingcode.com/cron-expression-editor)
[Online demo here](http://addonsv24.flowingcode.com/cron-expression-field)

## Download release

[Available in Vaadin Directory](https://vaadin.com/directory/component/cron-expression-editor-add-on)
[Available in Vaadin Directory](https://vaadin.com/directory/component/cron-expression-field-add-on)

### Maven install

Expand All @@ -30,7 +30,7 @@ Add the following dependencies in your pom.xml file:
```xml
<dependency>
<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>cron-expression-editor-addon</artifactId>
<artifactId>cron-expression-field-addon</artifactId>
<version>X.Y.Z</version>
</dependency>
```
Expand All @@ -47,7 +47,7 @@ To see the demo, navigate to http://localhost:8080/

## Release notes

See [here](https://github.com/FlowingCode/CronExpressionEditor/releases)
See [here](https://github.com/FlowingCode/CronExpressionField/releases)

## Issue tracking

Expand Down Expand Up @@ -87,7 +87,7 @@ Then, follow these steps for creating a contribution:

This add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.

CronExpressionEditor Add-on is written by Flowing Code S.A.
Cron Expression Field Add-on is written by Flowing Code S.A.

## Third-Party Dependencies

Expand All @@ -101,13 +101,13 @@ This project includes the following third-party dependency:

```java
// Create a new instance
CronExpressionEditor editor = new CronExpressionEditor();
CronExpressionField field = new CronExpressionField();

// Set default expression (optional)
editor.setDefaultExpression("0 0 12 * * ?");
field.setDefaultExpression("0 0 12 * * ?");

// Add to your layout
add(editor);
add(field);
```

## Special configuration when using Spring
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>cron-expression-editor-addon</artifactId>
<artifactId>cron-expression-field-addon</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Cron Expression Editor Add-on</name>
<name>Cron Expression Field Add-on</name>
<description>Component that assists in the generation of cron expressions</description>
<url>https://www.flowingcode.com/en/open-source/</url>

Expand Down Expand Up @@ -41,9 +41,9 @@
</licenses>

<scm>
<url>https://github.com/FlowingCode/AddonStarter24</url>
<connection>scm:git:git://github.com/FlowingCode/AddonStarter24.git</connection>
<developerConnection>scm:git:ssh://[email protected]:/FlowingCode/AddonStarter24.git</developerConnection>
<url>https://github.com/FlowingCode/CronExpressionField</url>
<connection>scm:git:git://github.com/FlowingCode/CronExpressionField.git</connection>
<developerConnection>scm:git:ssh://[email protected]:/FlowingCode/CronExpressionField.git</developerConnection>
<tag>master</tag>
</scm>

Expand Down Expand Up @@ -288,7 +288,7 @@
<vaadin.frontend.hotdeploy>true</vaadin.frontend.hotdeploy>
<systemProperty>
<key>vaadin.i18n.provider</key>
<value>com.flowingcode.vaadin.addons.cronexpressioneditor.TranslationProvider</value>
<value>com.flowingcode.vaadin.addons.cronexpressionfield.TranslationProvider</value>
</systemProperty>
</systemProperties>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-
* #%L
* Cron Expression Editor Add-on
* Cron Expression Field Add-on
* %%
* Copyright (C) 2025 Flowing Code
* %%
Expand All @@ -18,7 +18,7 @@
* #L%
*/

package com.flowingcode.vaadin.addons.cronexpressioneditor;
package com.flowingcode.vaadin.addons.cronexpressionfield;

import java.time.DayOfWeek;
import java.time.Duration;
Expand Down Expand Up @@ -58,7 +58,6 @@
import com.vaadin.flow.internal.JsonSerializer;
import com.vaadin.flow.theme.lumo.LumoUtility;
import elemental.json.JsonObject;
import org.springframework.format.annotation.DurationFormat.Unit;
import org.springframework.scheduling.support.CronExpression;
import it.burning.cron.CronExpressionDescriptor;
import it.burning.cron.CronExpressionParser.CronExpressionParseException;
Expand All @@ -71,8 +70,8 @@
* @author Sofia Nuñez / Flowing Code
*/
@SuppressWarnings("serial")
@CssImport(value = "./styles/cron-expression-editor-styles.css")
public class CronExpressionEditor extends CustomField<String> {
@CssImport(value = "./styles/cron-expression-field-styles.css")
public class CronExpressionField extends CustomField<String> {

/**
* Default value used only when {@code inputExpressionTf} and {@code defaultExpression} are empty. Represents every
Expand All @@ -94,24 +93,24 @@ protected enum Units {
SECONDS, MINUTES, HOURS;
}

private CronExpressionEditorI18n i18n;
private CronExpressionFieldI18n i18n;
private boolean helpEnabled;
private boolean commonExpressionsVisible;
private boolean cronInputEnabled;

/** Creates a new instance of {@code CronExpressionEditor} */
public CronExpressionEditor() {
this.setClassName("fc-cron-expression-editor");
/** Creates a new instance of {@code CronExpressionField} */
public CronExpressionField() {
this.setClassName("fc-cron-expression-field");
setI18n(null);
configureLayout();
}

/**
* Creates a new instance of {@code CronExpressionEditor} with a default expression.
* Creates a new instance of {@code CronExpressionField} with a default expression.
*
* @param defaultExpression a {@code String} representing the default cron expression to be set
*/
public CronExpressionEditor(String defaultExpression) {
public CronExpressionField(String defaultExpression) {
this();
setDefaultExpression(defaultExpression);
}
Expand Down Expand Up @@ -567,15 +566,15 @@ public void setLocale(Locale locale) {
}

/**
* Sets the internationalization settings for the editor.
* Sets the internationalization settings for the field.
* <p>
* If {@code i18n} is {@code null}, default internationalization to english.
* </p>
*
* @param i18n the {@link CronExpressionEditorI18n} to use, or {@code null} for default
* @param i18n the {@link CronExpressionFieldI18n} to use, or {@code null} for default
*/
public void setI18n(CronExpressionEditorI18n i18n) {
this.i18n = (i18n != null) ? i18n : CronExpressionEditorI18n.createDefault();
public void setI18n(CronExpressionFieldI18n i18n) {
this.i18n = (i18n != null) ? i18n : CronExpressionFieldI18n.createDefault();
getUI().ifPresent(ui -> setI18nWithJS());
}

Expand Down
Loading