Skip to content

Commit

Permalink
chore: remove unnecessary formatter instructions (#7016)
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker authored Jan 9, 2025
1 parent 61ce750 commit 1346233
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
* Set of theme variants applicable for {@code vaadin-avatar-group} component.
*/
public enum AvatarGroupVariant implements ThemeVariant {
//@formatter:off
LUMO_XLARGE("xlarge"),
LUMO_LARGE("large"),
LUMO_SMALL("small"),
LUMO_XSMALL("xsmall");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
* Set of theme variants applicable for {@code vaadin-avatar} component.
*/
public enum AvatarVariant implements ThemeVariant {
//@formatter:off
LUMO_XLARGE("xlarge"),
LUMO_LARGE("large"),
LUMO_SMALL("small"),
LUMO_XSMALL("xsmall");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* Set of theme variants applicable for {@code vaadin-button} component.
*/
public enum ButtonVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_LARGE("large"),
LUMO_TERTIARY("tertiary"),
Expand All @@ -34,7 +33,6 @@ public enum ButtonVariant implements ThemeVariant {
LUMO_ICON("icon"),
MATERIAL_CONTAINED("contained"),
MATERIAL_OUTLINED("outlined");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
* Set of theme variants applicable for {@code vaadin-card} component.
*/
public enum CardVariant implements ThemeVariant {
//@formatter:off
LUMO_ELEVATED("elevated"),
LUMO_OUTLINED("outlined"),
MATERIAL_ELEVATED("elevated"),
MATERIAL_OUTLINED("outlined");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
* Set of theme variants applicable for {@code vaadin-checkbox-group} component.
*/
public enum CheckboxGroupVariant implements ThemeVariant {
//@formatter:off
LUMO_VERTICAL("vertical"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_VERTICAL("vertical");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
* Set of theme variants applicable for {@code vaadin-combo-box} component.
*/
public enum ComboBoxVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_ALIGN_LEFT("align-left"),
LUMO_ALIGN_CENTER("align-center"),
LUMO_ALIGN_RIGHT("align-right"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_ALWAYS_FLOAT_LABEL("always-float-label");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
* component.
*/
public enum MultiSelectComboBoxVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_ALIGN_LEFT("align-left"),
LUMO_ALIGN_CENTER("align-center"),
LUMO_ALIGN_RIGHT("align-right"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_ALWAYS_FLOAT_LABEL("always-float-label");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
* Set of theme variants applicable for {@code vaadin-date-picker} component.
*/
public enum DatePickerVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_ALIGN_LEFT("align-left"),
LUMO_ALIGN_CENTER("align-center"),
LUMO_ALIGN_RIGHT("align-right"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_ALWAYS_FLOAT_LABEL("always-float-label");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
* component.
*/
public enum DateTimePickerVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_ALIGN_LEFT("align-left"),
LUMO_ALIGN_CENTER("align-center"),
LUMO_ALIGN_RIGHT("align-right"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_ALWAYS_FLOAT_LABEL("always-float-label");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ private Tooltip() {
* Tooltip position in relation to the target element.
*/
public enum TooltipPosition {
//@formatter:off
TOP_START("top-start"),
TOP("top"),
TOP_END("top-end"),
Expand All @@ -63,7 +62,6 @@ public enum TooltipPosition {
END_TOP("end-top"),
END("end"),
END_BOTTOM("end-bottom");
//@formatter:off

private final String position;

Expand All @@ -79,12 +77,14 @@ public String getPosition() {
* Gets the {@link TooltipPosition} for the given position string.
* Returns {@link TooltipPosition#BOTTOM} if no match is found.
*
* @param position the position string
* @param position
* the position string
* @return the {@link TooltipPosition}
*/
public static TooltipPosition fromPosition(String position) {
return Arrays.stream(TooltipPosition.values())
.filter(p -> p.getPosition().equals(position)).findFirst().orElse(BOTTOM);
.filter(p -> p.getPosition().equals(position)).findFirst()
.orElse(BOTTOM);
}
}

Expand All @@ -104,7 +104,8 @@ private static Tooltip forElement(Element element) {
// Remove the tooltip from its current state tree
tooltip.tooltipElement.removeFromTree(false);

// The host under which the <vaadin-tooltip> element is auto-attached
// The host under which the <vaadin-tooltip> element is
// auto-attached
var tooltipHost = UI.getCurrent().getElement();
tooltipHost.appendChild(tooltip.tooltipElement);
tooltip.tooltipElement.executeJs("this.target = $0;", element);
Expand All @@ -122,7 +123,8 @@ private static Tooltip forElement(Element element) {
}

/**
* Creates a tooltip to the given {@code Component} if one hasn't already been created.
* Creates a tooltip to the given {@code Component} if one hasn't already
* been created.
*
* @param component
* the component to attach the tooltip to
Expand Down Expand Up @@ -150,17 +152,18 @@ static Tooltip getForElement(Element element) {
}

/**
* Creates a tooltip to the given {@link HasTooltip} component
* and adds the tooltip element to the component's tooltip slot.
* Creates a tooltip to the given {@link HasTooltip} component and adds the
* tooltip element to the component's tooltip slot.
*
* @param hasTooltip
* the component to attach the tooltip to
* the component to attach the tooltip to
* @return the tooltip handle
*/
static Tooltip forHasTooltip(HasTooltip hasTooltip) {
var tooltip = new Tooltip();
SlotUtils.setSlot(hasTooltip, "tooltip", tooltip.tooltipElement);
var component = ComponentUtil.getInnermostComponent(hasTooltip.getElement());
var component = ComponentUtil
.getInnermostComponent(hasTooltip.getElement());
ComponentUtil.setData(component, TOOLTIP_DATA_KEY, tooltip);
return tooltip;
}
Expand Down Expand Up @@ -196,8 +199,8 @@ public Tooltip withText(String text) {
}

/**
* The delay in milliseconds before the tooltip is opened on keyboard focus, when not
* in manual mode.
* The delay in milliseconds before the tooltip is opened on keyboard focus,
* when not in manual mode.
*
* @param focusDelay
* the delay in milliseconds
Expand All @@ -207,8 +210,8 @@ public void setFocusDelay(int focusDelay) {
}

/**
* The delay in milliseconds before the tooltip is opened on keyboard focus, when not
* in manual mode.
* The delay in milliseconds before the tooltip is opened on keyboard focus,
* when not in manual mode.
*
* @return the delay in milliseconds
*/
Expand All @@ -217,8 +220,8 @@ public int getFocusDelay() {
}

/**
* The delay in milliseconds before the tooltip is opened on keyboard focus, when not
* in manual mode.
* The delay in milliseconds before the tooltip is opened on keyboard focus,
* when not in manual mode.
*
* @param focusDelay
* the delay in milliseconds
Expand Down Expand Up @@ -312,7 +315,8 @@ public void setPosition(TooltipPosition position) {
public TooltipPosition getPosition() {
var positionString = tooltipElement.getProperty("position");
return Arrays.stream(TooltipPosition.values())
.filter(p -> p.getPosition().equals(positionString)).findFirst().orElse(null);
.filter(p -> p.getPosition().equals(positionString)).findFirst()
.orElse(null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
* Set of theme variants applicable for {@code vaadin-grid} component.
*/
public enum GridVariant {
//@formatter:off
LUMO_NO_BORDER("no-border"),
LUMO_NO_ROW_BORDERS("no-row-borders"),
LUMO_COLUMN_BORDERS("column-borders"),
LUMO_ROW_STRIPES("row-stripes"),
LUMO_COMPACT("compact"),
LUMO_WRAP_CELL_CONTENT("wrap-cell-content"),
MATERIAL_COLUMN_DIVIDERS( "column-dividers");

//@formatter:on
MATERIAL_COLUMN_DIVIDERS("column-dividers");

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* Set of theme variants applicable for {@code vaadin-grid-pro} component.
*/
public enum GridProVariant {
//@formatter:off
LUMO_NO_BORDER("no-border"),
LUMO_NO_ROW_BORDERS("no-row-borders"),
LUMO_COLUMN_BORDERS("column-borders"),
Expand All @@ -23,8 +22,6 @@ public enum GridProVariant {
LUMO_HIGHLIGHT_EDITABLE_CELLS("highlight-editable-cells"),
LUMO_HIGHLIGHT_READ_ONLY_CELLS("highlight-read-only-cells");

//@formatter:on

private final String variant;

GridProVariant(String variant) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* Set of theme variants applicable for {@code vaadin-menu-bar} component.
*/
public enum MenuBarVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_LARGE("large"),
LUMO_TERTIARY("tertiary"),
Expand All @@ -34,7 +33,6 @@ public enum MenuBarVariant implements ThemeVariant {
MATERIAL_CONTAINED("contained"),
MATERIAL_OUTLINED("outlined"),
MATERIAL_END_ALIGNED("end-aligned");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* Popover position in relation to the target element.
*/
public enum PopoverPosition {
//@formatter:off
TOP_START("top-start"),
TOP("top"),
TOP_END("top-end"),
Expand All @@ -32,7 +31,6 @@ public enum PopoverPosition {
END_TOP("end-top"),
END("end"),
END_BOTTOM("end-bottom");
//@formatter:off

private final String position;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
* Set of theme variants applicable for the {@link Popover} component.
*/
public enum PopoverVariant implements ThemeVariant {
//@formatter:off
ARROW("arrow"),
LUMO_NO_PADDING("no-padding"),
MATERIAL_NO_PADDING("no-padding");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
* Set of theme variants applicable for {@code vaadin-radio-group} component.
*/
public enum RadioGroupVariant implements ThemeVariant {
//@formatter:off
LUMO_VERTICAL("vertical"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_VERTICAL("vertical");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
* component.
*/
public enum RichTextEditorVariant implements ThemeVariant {
//@formatter:off
LUMO_NO_BORDER("no-border"),
LUMO_COMPACT("compact"),
MATERIAL_NO_BORDER("no-border");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
* Set of theme variants applicable for {@code vaadin-select} component.
*/
public enum SelectVariant implements ThemeVariant {
//@formatter:off
LUMO_SMALL("small"),
LUMO_ALIGN_LEFT("align-left"),
LUMO_ALIGN_CENTER("align-center"),
LUMO_ALIGN_RIGHT("align-right"),
LUMO_HELPER_ABOVE_FIELD("helper-above-field"),
MATERIAL_ALWAYS_FLOAT_LABEL("always-float-label");
//@formatter:on

private final String variant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@
* Set of theme variants applicable for {@code vaadin-tabsheet} component.
*/
public enum TabSheetVariant implements ThemeVariant {
//@formatter:off
/**
* @deprecated Use {@code TabVariant.LUMO_ICON_ON_TOP} on individual {@code Tab} instances instead.
* @deprecated Use {@code TabVariant.LUMO_ICON_ON_TOP} on individual
* {@code Tab} instances instead.
*/
@Deprecated
LUMO_TABS_ICON_ON_TOP("icon-on-top"),
LUMO_TABS_CENTERED("centered"),
LUMO_TABS_SMALL("small"),
LUMO_TABS_MINIMAL("minimal"),
LUMO_TABS_HIDE_SCROLL_BUTTONS("hide-scroll-buttons"),
LUMO_TABS_EQUAL_WIDTH_TABS( "equal-width-tabs"),
LUMO_TABS_EQUAL_WIDTH_TABS("equal-width-tabs"),
LUMO_BORDERED("bordered"),
LUMO_NO_PADDING("no-padding"),
MATERIAL_TABS_FIXED("fixed"),
MATERIAL_BORDERED("bordered");
//@formatter:on

private final String variant;

Expand Down
Loading

0 comments on commit 1346233

Please sign in to comment.