Skip to content

Commit

Permalink
Typos, Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Jul 24, 2024
1 parent 249bdf8 commit 8d647cc
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public interface MessageProducer extends Serializable {
* {@link #getMessageFor(String, jakarta.faces.application.FacesMessage.Severity, Object...)}
* that sets in addition the Messages into the {@link FacesContext}
*
* @param messagekey must no be null FacesMessage.Severity severity
* @param messagekey must not be null FacesMessage.Severity severity
* @param severity The Severity level of the Message, must not be null.
* @param componentId identifying the component, may be null.
* @param componentId identifying the component may be null.
* @param parameter Ellipses of Object Parameter for MessageFormat
*/
void setFacesMessage(String messagekey, FacesMessage.Severity severity, String componentId, Object... parameter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public class BaseCuiHtmlSelectBooleanCheckboxComponent extends HtmlSelectBoolean
implements ComponentBridge, ComponentStyleClassProvider, StyleAttributeProvider {

@Delegate
private final ComponentStyleClassProvider styleClassProvider;
protected final ComponentStyleClassProvider styleClassProvider;

@Delegate
private final StyleAttributeProvider styleAttributeProvider;
protected final StyleAttributeProvider styleAttributeProvider;

/***/
public BaseCuiHtmlSelectBooleanCheckboxComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import jakarta.faces.context.FacesContext;

/**
* Minimal super-set for cui-based components that are at least {@link UIInput}.
* Minimal superset for cui-based components that are at least {@link UIInput}.
* Therefore, it provides the handling of the styleClass and style attribute and
* the implicit attributes provided by {@link UIInput}.
* In addition, it acts as a {@link ComponentBridge}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import jakarta.faces.context.FacesContext;

/**
* Minimal super-set for cui-based components that are at least
* Minimal superset for cui-based components that are at least
* {@link UINamingContainer}.
* Therefore, it provides the handling of the
* styleClass and style attribute and the implicit attributes provided by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void processEvent(final ComponentSystemEvent event) {
* will be called at {@link PostAddToViewEvent} and only if the component is
* set to {@code rendered=true}
*
* @param parent to be decorated, wrapped into an corresponding
* @param parent to be decorated, wrapped into a corresponding
* {@link ComponentModifier}, is never null
*/
public abstract void decorate(final ComponentModifier parent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
import lombok.Getter;

/**
* Represents a partial html tree. It provides a number of fluent builder in
* order to simplify the creation. methods in order to interact with
* Represents a partial html tree.
* It provides a number of fluent builders to simplify the creation.
* In addition, it provides methods to interact with
*
* @author Oliver Wolff
*/
Expand Down Expand Up @@ -200,7 +201,7 @@ public HtmlTreeBuilder withAttribute(final AttributeName attributeName, final St
}

/**
* Adds the 'name' and 'id' attributes attribute to the current dom-element.
* Adds the 'name' and 'id' attributes to the current dom-element.
*
* @param attributeValue to be set as 'name' and 'id'
* @return the {@link HtmlTreeBuilder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
*/
package de.cuioss.jsf.api.components.javascript;

import jakarta.faces.component.UIComponent;

import de.cuioss.jsf.api.components.util.ComponentWrapper;
import jakarta.faces.component.UIComponent;
import lombok.AccessLevel;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

/**
* Simple base class for creating JQuery-specific selectors: e.g for a given
* Simple base class for creating JQuery-specific selectors: e.g., for a given
* component providing the id "a:b" it returns "jQuery('#a\\\\:b')" saying it
* takes care on the proper masking of the clientIds.
*
Expand All @@ -34,7 +33,9 @@
@ToString
public class ComponentWrapperJQuerySelector extends JQuerySelector {

/** Runtime access on component specific attributes. */
/**
* Runtime access on component specific attributes.
*/
@NonNull
private final ComponentWrapper<? extends UIComponent> componentWrapper;

Expand Down Expand Up @@ -65,14 +66,14 @@ public static class ComponentWrapperJQuerySelectorBuilder {
* @return an instance of {@link ComponentWrapperJQuerySelectorBuilder}
*/
public ComponentWrapperJQuerySelectorBuilder withComponentWrapper(
final ComponentWrapper<? extends UIComponent> componentWrapper) {
final ComponentWrapper<? extends UIComponent> componentWrapper) {
this.componentWrapper = componentWrapper;
return this;
}

/**
* @param idExtension if not null it will be appended to the derived ClientId.
* In addition there will be an underscore appended: The
* @param idExtension if not null, it will be appended to the derived ClientId.
* In addition, there will be an underscore appended: The
* result will be component.getClientId() + "_" + idExtension
* @return an instance of {@link ComponentWrapperJQuerySelectorBuilder}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package de.cuioss.jsf.api.components.javascript;

import static de.cuioss.tools.string.MoreStrings.nullToEmpty;

import de.cuioss.tools.string.Joiner;
import de.cuioss.tools.string.Splitter;

import static de.cuioss.tools.string.MoreStrings.nullToEmpty;

/**
* Provides a simple way to create a correctly escaped JQuery-selector
*
Expand All @@ -33,9 +33,9 @@ public abstract class JQuerySelector implements ScriptProvider {
public static final String SELECTOR_TEMPLATE = "jQuery('#%s')";

/**
* @return the corresponding jQuerySelectorString, e.g for a given component
* providing the id "a:b" it returns "jQuery('#a\\\\:b')" saying it
* takes care on the proper masking of the clientIds.
* @return the corresponding jQuerySelectorString, e.g., for a given component
* providing the id "a:b" it returns "jQuery('#a\\\\:b')" saying it
* takes care on the proper masking of the clientIds.
*/
@Override
public String script() {
Expand All @@ -45,7 +45,7 @@ public String script() {
protected abstract String getIdString();

/**
* Escapes a given id String in order to be used within javascript, e.g for a
* Escapes a given id String to be used within javascript, e.g., for a
* given component providing the id "a:b" it returns "'a\\\\:b'" saying it takes
* care on the proper masking of the clientIds.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@
*/
package de.cuioss.jsf.api.components.javascript;

import java.io.Serial;
import java.io.Serializable;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
* Helper class to be used in conjunction with {@link JavaScriptOptions}. The
* problem: Each value will automatically put into double quotes. If you wrap
* the corresponding element in an instance of this type it will be taken
* the corresponding element in an instance of this type, it will be taken
* directly and not quoted.
*
* @author Oliver Wolff
*
*/
@RequiredArgsConstructor
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected void cancelAllEditItems() {
}

/**
* This removes new items that were in edit mode and have been canceled.
* This removes new items in edit mode and have been canceled.
*/
private void removeNullItems() {
getDisplayItems().removeIf(item -> !PERSISTED.equals(item.getAddStatus()) && null == item.getWrapped());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
*/
package de.cuioss.jsf.api.components.model.datalist.impl;

import static de.cuioss.tools.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;

import java.io.Serial;
import java.io.Serializable;

import de.cuioss.jsf.api.components.model.datalist.AddStatus;
import de.cuioss.jsf.api.components.model.datalist.EditStatus;
import de.cuioss.jsf.api.components.model.datalist.ItemWrapper;
Expand All @@ -29,15 +23,20 @@
import lombok.Setter;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

import static de.cuioss.tools.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;

/**
* @param <T> identifying the type of items to be created. Must be at least
* {@link Serializable} and implement {@link Object#hashCode()} and
* {@link Object#equals(Object)} correctly.
*
* @author Oliver Wolff
*/
@EqualsAndHashCode(of = { "wrapped", "editStatus" })
@ToString(of = { "wrapped", "editStatus" })
@EqualsAndHashCode(of = {"wrapped", "editStatus"})
@ToString(of = {"wrapped", "editStatus"})
public class ItemWrapperImpl<T extends Serializable> implements ItemWrapper<T> {

@Serial
Expand Down Expand Up @@ -66,7 +65,7 @@ public class ItemWrapperImpl<T extends Serializable> implements ItemWrapper<T> {
private int listIndex;

/**
* @param wrapped may be null
* @param wrapped maybe null
* @param editStatus must not be null.
*/
public ItemWrapperImpl(final T wrapped, final EditStatus editStatus) {
Expand Down Expand Up @@ -98,15 +97,15 @@ public ItemWrapperImpl() {
public void doSave() {
requireNonNull(wrapped, "Invalid usage: wrapped should not be null");
switch (initalEditStatus) {
case ADDED:
editStatus = EditStatus.ADDED;
addStatus = AddStatus.ADDED;
break;
case EDIT:
throw new IllegalStateException("Invalid usage: You must not doCancel or doSave prior to doEdit");
default:
editStatus = wrapped.equals(initialWrapped) ? EditStatus.INITIAL : EditStatus.MODIFIED;
break;
case ADDED:
editStatus = EditStatus.ADDED;
addStatus = AddStatus.ADDED;
break;
case EDIT:
throw new IllegalStateException("Invalid usage: You must not doCancel or doSave prior to doEdit");
default:
editStatus = wrapped.equals(initialWrapped) ? EditStatus.INITIAL : EditStatus.MODIFIED;
break;
}
initialWrapped = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@
*/
package de.cuioss.jsf.api.components.model.menu;

import de.cuioss.jsf.api.application.navigation.NavigationUtils;
import de.cuioss.jsf.api.components.support.LabelResolver;
import jakarta.faces.context.FacesContext;
import lombok.*;

import java.io.Serial;
import java.util.ArrayList;
import java.util.List;

import jakarta.faces.context.FacesContext;

import de.cuioss.jsf.api.application.navigation.NavigationUtils;
import de.cuioss.jsf.api.components.support.LabelResolver;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
* Basic Implementation of a {@link NavigationMenuItem}
*
Expand Down Expand Up @@ -74,7 +69,7 @@ public abstract class NavigationMenuItemImpl implements NavigationMenuItem {
private String parentId;

/**
* Allows to configure a list of view ids that should trigger displaying the
* Allows configuring a list of view ids that should trigger displaying the
* menu item in "active" mode.
*/
@Getter
Expand All @@ -89,7 +84,7 @@ public int compareTo(final NavigationMenuItem other) {
@Override
public String getResolvedTitle() {
return LabelResolver.builder().withLabelKey(titleKey).withLabelValue(titleValue).build()
.resolve(FacesContext.getCurrentInstance());
.resolve(FacesContext.getCurrentInstance());
}

@Override
Expand All @@ -100,7 +95,7 @@ public boolean isTitleAvailable() {
@Override
public boolean isActive() {
return !getActiveForAdditionalViewId().isEmpty() && getActiveForAdditionalViewId()
.contains(NavigationUtils.getCurrentView(FacesContext.getCurrentInstance()).getViewId());
.contains(NavigationUtils.getCurrentView(FacesContext.getCurrentInstance()).getViewId());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ namespace Cui.Core {
jQuery('.modal').modal('hide');
jQuery('[data-modal-dialog-id=confirmDialogTimeout]').modal('show');
jQuery(document.body).addClass('modal-timeout');
onIdle.forEach((callback: () => void) => {
callback();
});
onIdle.forEach((callback:() => void) => { callback(); });
}

/**
* Execute open external application in new window (or tab depend on browser and settings) and set focus on this
* Execute open external application in a new window (or tab depend on browser and settings) and set focus on this
* @param applicationUrl
*/
export function openExternalApplicationInNewWindow(applicationUrl: string): void {
Expand Down

0 comments on commit 8d647cc

Please sign in to comment.