Skip to content

Commit

Permalink
Applying IDE-Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Jul 29, 2023
1 parent 5eb82ec commit 55c8c39
Show file tree
Hide file tree
Showing 260 changed files with 1,893 additions and 2,397 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public final class BootstrapFamily {
/**
* The component for {@link AccordionComponent}
*/
public static final String ACCORDION_COMPONENT =
"de.cuioss.bootstrap.accordion";
public static final String ACCORDION_COMPONENT = "de.cuioss.bootstrap.accordion";

/**
* Default Renderer for {@link AccordionComponent}
Expand All @@ -60,8 +59,7 @@ public final class BootstrapFamily {
/**
* The component id for {@link BadgeComponent}
*/
public static final String BADGE_COMPONENT =
"de.cuioss.bootstrap.badge";
public static final String BADGE_COMPONENT = "de.cuioss.bootstrap.badge";

// Button
/**
Expand All @@ -72,8 +70,7 @@ public final class BootstrapFamily {
/**
* Standard renderer for {@link Button}
*/
public static final String BUTTON_RENDERER =
"de.cuioss.bootstrap.button_renderer";
public static final String BUTTON_RENDERER = "de.cuioss.bootstrap.button_renderer";

// CommandButton
/**
Expand All @@ -84,8 +81,7 @@ public final class BootstrapFamily {
/**
* Standard renderer for {@link CommandButton}
*/
public static final String COMMAND_BUTTON_RENDERER =
"de.cuioss.bootstrap.commandbutton_renderer";
public static final String COMMAND_BUTTON_RENDERER = "de.cuioss.bootstrap.commandbutton_renderer";
/**
* The component id for {@link CloseCommandButton}
*/
Expand All @@ -94,8 +90,7 @@ public final class BootstrapFamily {
/**
* Standard renderer for {@link CloseCommandButton}
*/
public static final String CLOSE_COMMAND_BUTTON_RENDERER =
"de.cuioss.bootstrap.close_commandbutton_renderer";
public static final String CLOSE_COMMAND_BUTTON_RENDERER = "de.cuioss.bootstrap.close_commandbutton_renderer";

/**
* "de.cuioss.cui.components.bootstrap.family"
Expand All @@ -110,8 +105,7 @@ public final class BootstrapFamily {
/**
* Standard renderer for {@link CuiMessageComponent}
*/
public static final String CUI_MESSAGE_COMPONENT_RENDERER =
"de.cuioss.bootstrap.cuimessage_renderer";
public static final String CUI_MESSAGE_COMPONENT_RENDERER = "de.cuioss.bootstrap.cuimessage_renderer";

/**
* The component id for {@link CuiMessagesComponent}
Expand All @@ -137,20 +131,17 @@ public final class BootstrapFamily {
/**
* The component id for {@link LabeledContainerComponent}
*/
public static final String LABELED_CONTAINER_COMPONENT =
"de.cuioss.bootstrap.labeledContainer";
public static final String LABELED_CONTAINER_COMPONENT = "de.cuioss.bootstrap.labeledContainer";

/**
* Standard renderer for {@link LabeledContainerComponent}
*/
public static final String LABELED_CONTAINER_COMPONENT_RENDERER =
"de.cuioss.bootstrap.labeledContainer_renderer";
public static final String LABELED_CONTAINER_COMPONENT_RENDERER = "de.cuioss.bootstrap.labeledContainer_renderer";

/**
* The component id for {@link InputGuardComponent}
*/
public static final String GUARDED_INPUT_COMPONENT =
"de.cuioss.bootstrap.guarded_input";
public static final String GUARDED_INPUT_COMPONENT = "de.cuioss.bootstrap.guarded_input";

// labeledIcon
/**
Expand All @@ -161,8 +152,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link MimeTypeIconComponent}
*/
public static final String LABELED_ICON_COMPONENT_RENDERER =
"de.cuioss.bootstrap.icon.labeled_renderer";
public static final String LABELED_ICON_COMPONENT_RENDERER = "de.cuioss.bootstrap.icon.labeled_renderer";

/**
* The component id for {@link ColumnComponent}
Expand All @@ -172,14 +162,12 @@ public final class BootstrapFamily {
/**
* The component id for {@link ControlGroupComponent}
*/
public static final String LAYOUT_CONTROL_GROUP_COMPONENT =
"de.cuioss.bootstrap.controlgroup";
public static final String LAYOUT_CONTROL_GROUP_COMPONENT = "de.cuioss.bootstrap.controlgroup";

/**
* Default Renderer for {@link ControlGroupComponent}
*/
public static final String LAYOUT_CONTROL_GROUP_RENDERER =
"de.cuioss.bootstrap.controlgroup_renderer";
public static final String LAYOUT_CONTROL_GROUP_RENDERER = "de.cuioss.bootstrap.controlgroup_renderer";

/**
* The component id for {@link FormGroupComponent}
Expand Down Expand Up @@ -209,8 +197,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link ModalDialogComponent}
*/
public static final String MODAL_DIALOG_COMPONENT_RENDERER =
"de.cuioss.bootstrap.modal_dialog_renderer";
public static final String MODAL_DIALOG_COMPONENT_RENDERER = "de.cuioss.bootstrap.modal_dialog_renderer";

/**
* {@link AbstractParentDecorator} for controlling {@link ModalDialogComponent}
Expand All @@ -226,8 +213,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link MimeTypeIconComponent}
*/
public static final String MIME_TYPE_ICON_COMPONENT_RENDERER =
"de.cuioss.bootstrap.icon.mime_type_renderer";
public static final String MIME_TYPE_ICON_COMPONENT_RENDERER = "de.cuioss.bootstrap.icon.mime_type_renderer";

// NavigationMenu
/**
Expand All @@ -238,8 +224,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link NavigationMenuComponent}
*/
public static final String NAVIGATION_MENU_COMPONENT_RENDERER =
"de.cuioss.bootstrap.navigationmenu_renderer";
public static final String NAVIGATION_MENU_COMPONENT_RENDERER = "de.cuioss.bootstrap.navigationmenu_renderer";

// NavigationMenu
/**
Expand All @@ -250,8 +235,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link NavigationMenuComponent}
*/
public static final String NAVIGATION_MENU_CONTAINER_COMPONENT_RENDERER =
"de.cuioss.bootstrap.navigationmenu_container_renderer";
public static final String NAVIGATION_MENU_CONTAINER_COMPONENT_RENDERER = "de.cuioss.bootstrap.navigationmenu_container_renderer";

/**
* The component id for {@link NotificationBoxComponent}
Expand All @@ -261,8 +245,7 @@ public final class BootstrapFamily {
/**
* Standard renderer for {@link NotificationBoxComponent}
*/
public static final String NOTIFICATION_BOX_RENDERER =
"de.cuioss.bootstrap.notificationbox_renderer";
public static final String NOTIFICATION_BOX_RENDERER = "de.cuioss.bootstrap.notificationbox_renderer";

/**
* The component id for {@link OutputLabelComponent}
Expand All @@ -287,8 +270,7 @@ public final class BootstrapFamily {
/**
* The component for {@link TabPanelComponent}
*/
public static final String TAB_PANEL_COMPONENT =
"de.cuioss.bootstrap.tab_panel";
public static final String TAB_PANEL_COMPONENT = "de.cuioss.bootstrap.tab_panel";

/**
* Default Renderer for {@link TabPanelComponent}
Expand All @@ -315,8 +297,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link TagInputRenderer}
*/
public static final String TAG_INPUT_COMPONENT_RENDERER =
"de.cuioss.bootstrap.taginput_renderer";
public static final String TAG_INPUT_COMPONENT_RENDERER = "de.cuioss.bootstrap.taginput_renderer";

// TagList
/**
Expand All @@ -327,8 +308,7 @@ public final class BootstrapFamily {
/**
* Default Renderer for {@link TagListComponent}
*/
public static final String TAG_LIST_COMPONENT_RENDERER =
"de.cuioss.bootstrap.taglist_renderer";
public static final String TAG_LIST_COMPONENT_RENDERER = "de.cuioss.bootstrap.taglist_renderer";

/**
* The component for {@link ToolbarComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class AccordionComponent extends BasicBootstrapPanelComponent {

/***/
public AccordionComponent() {
super();
super.setRendererType(BootstrapFamily.ACCORDION_RENDERER);
activeIndexManagerProvider = new ActiveIndexManagerProvider(this);
state = new CuiState(getStateHelper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
* @author Matthias Walliczek
* @author Sven Haag
*/
@FacesRenderer(rendererType = BootstrapFamily.ACCORDION_RENDERER,
componentFamily = BootstrapFamily.COMPONENT_FAMILY)
@FacesRenderer(rendererType = BootstrapFamily.ACCORDION_RENDERER, componentFamily = BootstrapFamily.COMPONENT_FAMILY)
@SuppressWarnings("resource") // owolff: No resource leak, because the actual response-writer is
// controlled by JSF
public class AccordionRenderer extends BaseDecoratorRenderer<AccordionComponent> {
Expand All @@ -34,8 +33,7 @@ public AccordionRenderer() {

@Override
protected void doEncodeBegin(final FacesContext context, final DecoratingResponseWriter<AccordionComponent> writer,
final AccordionComponent component)
throws IOException {
final AccordionComponent component) throws IOException {
writer.withStartElement(Node.DIV);
writer.withStyleClass(CssBootstrap.PANEL_GROUP.getStyleClassBuilder().append(component.getStyleClass()));
writer.withAttributeStyle(component.getStyle());
Expand All @@ -48,7 +46,7 @@ protected void doEncodeBegin(final FacesContext context, final DecoratingRespons
@Override
protected void doEncodeChildren(final FacesContext context,
final DecoratingResponseWriter<AccordionComponent> writer, final AccordionComponent component)
throws IOException {
throws IOException {

final var activeIndexes = component.resolveActiveIndexes();

Expand Down Expand Up @@ -76,8 +74,7 @@ protected void doEncodeChildren(final FacesContext context,

@Override
protected void doEncodeEnd(final FacesContext context, final DecoratingResponseWriter<AccordionComponent> writer,
final AccordionComponent component)
throws IOException {
final AccordionComponent component) throws IOException {
writer.withEndElement(Node.DIV);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@

/**
* <p>
* An extension to h:button that conforms to Bootstrap styling and incorporates the display
* of icons. Caution: do not use the value attribute but the corresponding labelKey / labelValue.
* The same goes for the title element: use titleKey or titleValue.
* An extension to h:button that conforms to Bootstrap styling and incorporates
* the display of icons. Caution: do not use the value attribute but the
* corresponding labelKey / labelValue. The same goes for the title element: use
* titleKey or titleValue.
* </p>
* <h2>Attributes</h2>
* <ul>
Expand All @@ -46,9 +47,10 @@
* <li>{@link IconAlignProvider}</li>
* <li>{@link LabelProvider}</li>
* <li>All attributes from {@link HtmlOutcomeTargetButton}</li>
* <li>keyBinding: The key-binding for this button, aka keyboard shortcut. The key will be bound as
* onClickHandler. Caution: The implementor must ensure that there is only one button for the same
* type existent per page, otherwise the behavior is non-deterministic.</li>
* <li>keyBinding: The key-binding for this button, aka keyboard shortcut. The
* key will be bound as onClickHandler. Caution: The implementor must ensure
* that there is only one button for the same type existent per page, otherwise
* the behavior is non-deterministic.</li>
* </ul>
*
* @author Oliver Wolff
Expand All @@ -57,8 +59,7 @@
@FacesComponent(BootstrapFamily.BUTTON_COMPONENT)
@ListenerFor(systemEventClass = PreRenderComponentEvent.class)
@SuppressWarnings("squid:MaximumInheritanceDepth") // Artifact of Jsf-structure
public class Button extends HtmlOutcomeTargetButton
implements ComponentBridge, TitleProvider {
public class Button extends HtmlOutcomeTargetButton implements ComponentBridge, TitleProvider {

private static final String KEY_BINDING_KEY = "keyBinding";

Expand Down Expand Up @@ -88,7 +89,6 @@ public class Button extends HtmlOutcomeTargetButton
* Constructor.
*/
public Button() {
super();
super.setRendererType(BootstrapFamily.BUTTON_RENDERER);
titleProvider = new TitleProviderImpl(this);
contextSizeProvider = new ContextSizeProvider(this);
Expand All @@ -105,8 +105,7 @@ public String getStyleClass() {
return CssBootstrap.BUTTON.getStyleClassBuilder()
.append(ButtonState.getForContextState(contextStateProvider.getState()))
.append(ButtonSize.getForContextSize(contextSizeProvider.resolveContextSize()))
.append(styleClassProvider)
.getStyleClass();
.append(styleClassProvider).getStyleClass();
}

@Override
Expand Down Expand Up @@ -158,14 +157,16 @@ public String getTitle() {
}

/**
* @return boolean indicating whether to display an icon on the right side of the button text
* @return boolean indicating whether to display an icon on the right side of
* the button text
*/
public boolean isDisplayIconRight() {
return iconProvider.isIconSet() && AlignHolder.RIGHT.equals(iconAlignProvider.resolveIconAlign());
}

/**
* @return boolean indicating whether to display an icon on the left side of the button text
* @return boolean indicating whether to display an icon on the left side of the
* button text
*/
public boolean isDisplayIconLeft() {
return iconProvider.isIconSet() && !AlignHolder.RIGHT.equals(iconAlignProvider.resolveIconAlign());
Expand All @@ -186,16 +187,13 @@ public String getKeyBinding() {
}

/**
* Factory method to instantiate a concrete instance of
* {@link Button}, usually used if you programmatically add it
* as a child.
* Factory method to instantiate a concrete instance of {@link Button}, usually
* used if you programmatically add it as a child.
*
* @param facesContext
* must not be null
* @param facesContext must not be null
* @return concrete instance of {@link Button}
*/
public static final Button create(final FacesContext facesContext) {
return (Button) facesContext.getApplication()
.createComponent(BootstrapFamily.BUTTON_COMPONENT);
return (Button) facesContext.getApplication().createComponent(BootstrapFamily.BUTTON_COMPONENT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
* <h2>Rendering</h2>
* <p>
* This {@link Renderer} uses the concrete implementation specific Renderer for
* {@code h:button} accessed by {@link JsfHtmlComponent#BUTTON}. This is used for creating the start
* element of the element including all attributes like onclick,.. . On the fly the {@code input}
* element will be replaced by {@code button}. This is done by passing an instance of
* {@link ElementReplacingResponseWriter}. The {@link Renderer#decode(FacesContext, UIComponent)}
* will be passed to the specific renderer as well.
* {@code h:button} accessed by {@link JsfHtmlComponent#BUTTON}. This is used
* for creating the start element of the element including all attributes like
* onclick,.. . On the fly the {@code input} element will be replaced by
* {@code button}. This is done by passing an instance of
* {@link ElementReplacingResponseWriter}. The
* {@link Renderer#decode(FacesContext, UIComponent)} will be passed to the
* specific renderer as well.
* </p>
* <h2>Styling</h2>
* <ul>
Expand All @@ -33,8 +35,7 @@
*
* @author Oliver Wolff
*/
@FacesRenderer(componentFamily = BootstrapFamily.COMPONENT_FAMILY,
rendererType = BootstrapFamily.BUTTON_RENDERER)
@FacesRenderer(componentFamily = BootstrapFamily.COMPONENT_FAMILY, rendererType = BootstrapFamily.BUTTON_RENDERER)
public class ButtonRenderer extends BaseDecoratorRenderer<Button> {

/**
Expand All @@ -46,10 +47,9 @@ public ButtonRenderer() {

@Override
protected void doEncodeBegin(final FacesContext context, final DecoratingResponseWriter<Button> writer,
final Button component)
throws IOException {
var wrapped =
ElementReplacingResponseWriter.createWrappedReplacingResonseWriter(context, "input", "button", true);
final Button component) throws IOException {
var wrapped = ElementReplacingResponseWriter.createWrappedReplacingResonseWriter(context, "input", "button",
true);
JsfHtmlComponent.BUTTON.renderer(context).encodeBegin(wrapped, component);
if (component.isDisplayIconLeft()) {
var icon = IconComponent.createComponent(context);
Expand Down Expand Up @@ -80,8 +80,7 @@ public void decode(final FacesContext context, final UIComponent component) {
@SuppressWarnings("resource") // owolff: No resource leak, because the actual response-writer is
// controlled by JSF
protected void doEncodeEnd(final FacesContext context, final DecoratingResponseWriter<Button> writer,
final Button component)
throws IOException {
final Button component) throws IOException {
writer.withEndElement(Node.BUTTON);
}

Expand Down
Loading

0 comments on commit 55c8c39

Please sign in to comment.