Skip to content

Commit

Permalink
Style fixes (MID-4715)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Oct 21, 2019
1 parent 9d30a19 commit f718fa8
Show file tree
Hide file tree
Showing 84 changed files with 481 additions and 606 deletions.
2 changes: 2 additions & 0 deletions build-tools/src/main/resources/midpoint-build/checkstyle.xml
Expand Up @@ -29,6 +29,8 @@

<module name="ConstantName"/>
<module name="LocalFinalVariableName">
<!-- mostly due to TEST_NAME used a lot in the tests -->
<!-- Maybe we need to change that to lowercase convention later -->
<property name="format" value="^[a-zA-Z0-9_]+$"/>
</module>
<module name="LocalVariableName"/>
Expand Down
Expand Up @@ -42,8 +42,8 @@ public class DropdownButtonPanel extends BasePanel<DropdownButtonDto> {
private static final String ID_LABEL = "label";

private static final String ID_DROPDOWN_MENU = "dropDownMenu";
private static String ID_MENU_ITEM = "menuItem";
private static String ID_MENU_ITEM_BODY = "menuItemBody";
private static final String ID_MENU_ITEM = "menuItem";
private static final String ID_MENU_ITEM_BODY = "menuItemBody";


public DropdownButtonPanel(String id, DropdownButtonDto model) {
Expand Down
Expand Up @@ -111,7 +111,6 @@
import com.evolveum.midpoint.wf.util.ChangesByState;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ExecuteScriptType;
import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType;
import com.evolveum.prism.xml.ns._public.query_3.QueryType;
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
Expand Down Expand Up @@ -254,22 +253,22 @@ public final class WebComponentUtil {

}

private static final Map<String, LoggingComponentType> componentMap = new HashMap<>();
private static final Map<String, LoggingComponentType> COMPONENT_MAP = new HashMap<>();

static {
componentMap.put("com.evolveum.midpoint", LoggingComponentType.ALL);
componentMap.put("com.evolveum.midpoint.model", LoggingComponentType.MODEL);
componentMap.put("com.evolveum.midpoint.provisioning", LoggingComponentType.PROVISIONING);
componentMap.put("com.evolveum.midpoint.repo", LoggingComponentType.REPOSITORY);
componentMap.put("com.evolveum.midpoint.web", LoggingComponentType.WEB);
componentMap.put("com.evolveum.midpoint.gui", LoggingComponentType.GUI);
componentMap.put("com.evolveum.midpoint.task", LoggingComponentType.TASKMANAGER);
componentMap.put("com.evolveum.midpoint.model.sync",
COMPONENT_MAP.put("com.evolveum.midpoint", LoggingComponentType.ALL);
COMPONENT_MAP.put("com.evolveum.midpoint.model", LoggingComponentType.MODEL);
COMPONENT_MAP.put("com.evolveum.midpoint.provisioning", LoggingComponentType.PROVISIONING);
COMPONENT_MAP.put("com.evolveum.midpoint.repo", LoggingComponentType.REPOSITORY);
COMPONENT_MAP.put("com.evolveum.midpoint.web", LoggingComponentType.WEB);
COMPONENT_MAP.put("com.evolveum.midpoint.gui", LoggingComponentType.GUI);
COMPONENT_MAP.put("com.evolveum.midpoint.task", LoggingComponentType.TASKMANAGER);
COMPONENT_MAP.put("com.evolveum.midpoint.model.sync",
LoggingComponentType.RESOURCEOBJECTCHANGELISTENER);
componentMap.put("com.evolveum.midpoint.wf", LoggingComponentType.WORKFLOWS);
componentMap.put("com.evolveum.midpoint.notifications", LoggingComponentType.NOTIFICATIONS);
componentMap.put("com.evolveum.midpoint.certification", LoggingComponentType.ACCESS_CERTIFICATION);
componentMap.put("com.evolveum.midpoint.security", LoggingComponentType.SECURITY);
COMPONENT_MAP.put("com.evolveum.midpoint.wf", LoggingComponentType.WORKFLOWS);
COMPONENT_MAP.put("com.evolveum.midpoint.notifications", LoggingComponentType.NOTIFICATIONS);
COMPONENT_MAP.put("com.evolveum.midpoint.certification", LoggingComponentType.ACCESS_CERTIFICATION);
COMPONENT_MAP.put("com.evolveum.midpoint.security", LoggingComponentType.SECURITY);
}

public enum AssignmentOrder{
Expand Down
Expand Up @@ -90,6 +90,7 @@ public class WebModelServiceUtils {
private static final String OPERATION_ASSUME_POWER_OF_ATTORNEY = DOT_CLASS + "assumePowerOfAttorney";
private static final String OPERATION_DROP_POWER_OF_ATTORNEY = DOT_CLASS + "dropPowerOfAttorney";
private static final String OPERATION_GET_SYSTEM_CONFIG = DOT_CLASS + "getSystemConfiguration";
private static final String OPERATION_LOAD_FLOW_POLICY = DOT_CLASS + "loadFlowPolicy";

public static String resolveReferenceName(ObjectReferenceType ref, PageBase page) {
Task task = page.createSimpleTask(WebModelServiceUtils.class.getName() + ".resolveReferenceName");
Expand Down Expand Up @@ -778,7 +779,6 @@ public static boolean isPostAuthenticationEnabled(TaskManager taskManager, Model
MidPointPrincipal midpointPrincipal = SecurityUtils.getPrincipalUser();
if (midpointPrincipal != null) {
UserType user = midpointPrincipal.getUser();
String OPERATION_LOAD_FLOW_POLICY = WebModelServiceUtils.class.getName() + ".loadFlowPolicy";
Task task = taskManager.createTaskInstance(OPERATION_LOAD_FLOW_POLICY);
OperationResult parentResult = new OperationResult(OPERATION_LOAD_FLOW_POLICY);
RegistrationsPolicyType registrationPolicyType;
Expand Down
Expand Up @@ -60,8 +60,8 @@ public class PrismObjectWrapperFactoryImpl<O extends ObjectType> extends PrismCo
private static final String DOT_CLASS = PrismObjectWrapperFactoryImpl.class.getName() + ".";
private static final String OPERATION_DETERMINE_VIRTUAL_CONTAINERS = DOT_CLASS + "determineVirtualContainers";

private QName VIRTUAL_CONTAINER_COMPLEX_TYPE = new QName("VirtualContainerType");
private QName VIRTUAL_CONTAINER = new QName("virtualContainer");
private static final QName VIRTUAL_CONTAINER_COMPLEX_TYPE = new QName("VirtualContainerType");
private static final QName VIRTUAL_CONTAINER = new QName("virtualContainer");

@Autowired private GuiComponentRegistry registry;
@Autowired protected ModelInteractionService modelInteractionService;
Expand Down
Expand Up @@ -18,7 +18,7 @@

public class SearchFilterTypeModel implements IModel<String> {

private static transient Trace LOGGER = TraceManager.getTrace(SearchFilterTypeModel.class);
private static final transient Trace LOGGER = TraceManager.getTrace(SearchFilterTypeModel.class);

private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -17,29 +17,29 @@
* */
public final class ComponentLoggerType {

public static final Map<String, LoggingComponentType> componentMap = new HashMap<>();
public static final Map<String, LoggingComponentType> COMPONENT_MAP = new HashMap<>();

static {
componentMap.put("com.evolveum.midpoint", LoggingComponentType.ALL);
componentMap.put("com.evolveum.midpoint.model", LoggingComponentType.MODEL);
componentMap.put("com.evolveum.midpoint.provisioning", LoggingComponentType.PROVISIONING);
componentMap.put("com.evolveum.midpoint.repo", LoggingComponentType.REPOSITORY);
componentMap.put("com.evolveum.midpoint.web", LoggingComponentType.WEB);
componentMap.put("com.evolveum.midpoint.gui", LoggingComponentType.GUI);
componentMap.put("com.evolveum.midpoint.task", LoggingComponentType.TASKMANAGER);
componentMap.put("com.evolveum.midpoint.model.sync",
COMPONENT_MAP.put("com.evolveum.midpoint", LoggingComponentType.ALL);
COMPONENT_MAP.put("com.evolveum.midpoint.model", LoggingComponentType.MODEL);
COMPONENT_MAP.put("com.evolveum.midpoint.provisioning", LoggingComponentType.PROVISIONING);
COMPONENT_MAP.put("com.evolveum.midpoint.repo", LoggingComponentType.REPOSITORY);
COMPONENT_MAP.put("com.evolveum.midpoint.web", LoggingComponentType.WEB);
COMPONENT_MAP.put("com.evolveum.midpoint.gui", LoggingComponentType.GUI);
COMPONENT_MAP.put("com.evolveum.midpoint.task", LoggingComponentType.TASKMANAGER);
COMPONENT_MAP.put("com.evolveum.midpoint.model.sync",
LoggingComponentType.RESOURCEOBJECTCHANGELISTENER);
componentMap.put("com.evolveum.midpoint.wf", LoggingComponentType.WORKFLOWS);
componentMap.put("com.evolveum.midpoint.notifications", LoggingComponentType.NOTIFICATIONS);
componentMap.put("com.evolveum.midpoint.certification", LoggingComponentType.ACCESS_CERTIFICATION);
componentMap.put("com.evolveum.midpoint.security", LoggingComponentType.SECURITY);
COMPONENT_MAP.put("com.evolveum.midpoint.wf", LoggingComponentType.WORKFLOWS);
COMPONENT_MAP.put("com.evolveum.midpoint.notifications", LoggingComponentType.NOTIFICATIONS);
COMPONENT_MAP.put("com.evolveum.midpoint.certification", LoggingComponentType.ACCESS_CERTIFICATION);
COMPONENT_MAP.put("com.evolveum.midpoint.security", LoggingComponentType.SECURITY);
}

public static String getPackageByValue(LoggingComponentType value) {
if (value == null) {
return null;
}
for (Entry<String, LoggingComponentType> entry : componentMap.entrySet()) {
for (Entry<String, LoggingComponentType> entry : COMPONENT_MAP.entrySet()) {
if (value.equals(entry.getValue())) {
return entry.getKey();
}
Expand Down
Expand Up @@ -32,10 +32,10 @@
*/
public abstract class MultifunctionalButton<S extends Serializable> extends BasePanel<S> {

private static String ID_MAIN_BUTTON = "mainButton";
private static String ID_BUTTON = "additionalButton";
private static final String ID_MAIN_BUTTON = "mainButton";
private static final String ID_BUTTON = "additionalButton";

private static String DEFAULT_BUTTON_STYLE = "btn btn-default btn-sm buttons-panel-marging";
private static final String DEFAULT_BUTTON_STYLE = "btn btn-default btn-sm buttons-panel-marging";

public MultifunctionalButton(String id){
super(id);
Expand Down
Expand Up @@ -27,7 +27,6 @@
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.query.ObjectPaging;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import org.apache.wicket.model.IModel;

/**
* @author Viliam Repan (lazyman)
Expand Down
Expand Up @@ -81,19 +81,19 @@ private String getSecondCssClass(){
}

public String getFirstCssSizeClass(){
return DoubleButtonColumn.BUTTON_SIZE_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonSizeClass.DEFAULT.toString();
}

public String getSecondCssSizeClass(){
return DoubleButtonColumn.BUTTON_SIZE_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonSizeClass.DEFAULT.toString();
}

public String getFirstCssColorClass(){
return DoubleButtonColumn.BUTTON_COLOR_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonColorClass.DEFAULT.toString();
}

public String getSecondCssColorClass(){
return DoubleButtonColumn.BUTTON_COLOR_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonColorClass.DEFAULT.toString();
}

public String getFirstCaption(){
Expand Down
Expand Up @@ -63,11 +63,11 @@ private String getButtonCssClass(){
}

public String getButtonCssSizeClass(){
return DoubleButtonColumn.BUTTON_SIZE_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonSizeClass.DEFAULT.toString();
}

public String getButtonCssColorClass(){
return DoubleButtonColumn.BUTTON_COLOR_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonColorClass.DEFAULT.toString();
}

public String getCaption(){
Expand Down
Expand Up @@ -25,23 +25,23 @@ public class DoubleButtonColumn<T extends Serializable> extends AbstractColumn<

private DoubleButtonPanel panel;

public enum BUTTON_COLOR_CLASS{
public enum ButtonColorClass {
DEFAULT("btn-default"), PRIMARY("btn-primary"), SUCCESS("btn-success"),
INFO("btn-info"), WARNING("btn-warning"), DANGER("btn-danger");

private final String stringValue;

private BUTTON_COLOR_CLASS(final String s){stringValue = s;}
public String toString(){return stringValue;}
private ButtonColorClass(final String s) { stringValue = s; }
public String toString() { return stringValue; }
}

public enum BUTTON_SIZE_CLASS{
public enum ButtonSizeClass {
LARGE("btn-lg"), DEFAULT(""), SMALL("btn-sm"), EXTRA_SMALL("btn-xs");

private final String stringValue;

private BUTTON_SIZE_CLASS(final String s){stringValue = s;}
public String toString(){return stringValue;}
private ButtonSizeClass(final String s) { stringValue = s; }
public String toString() { return stringValue; }
}

private String firstCaption;
Expand Down Expand Up @@ -119,19 +119,19 @@ public void firstClicked(AjaxRequestTarget target, IModel<T> model){}
public void secondClicked(AjaxRequestTarget target, IModel<T> model){};

public String getFirstSizeCssClass(){
return BUTTON_SIZE_CLASS.SMALL.toString();
return ButtonSizeClass.SMALL.toString();
}

public String getSecondSizeCssClass(){
return BUTTON_SIZE_CLASS.SMALL.toString();
return ButtonSizeClass.SMALL.toString();
}

public String getFirstColorCssClass(){
return BUTTON_COLOR_CLASS.DEFAULT.toString();
return ButtonColorClass.DEFAULT.toString();
}

public String getSecondColorCssClass(){
return BUTTON_COLOR_CLASS.DEFAULT.toString();
return ButtonColorClass.DEFAULT.toString();
}

public String getFirstCap(){
Expand Down
Expand Up @@ -7,7 +7,6 @@

package com.evolveum.midpoint.web.component.data.column;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.web.component.AjaxIconButton;
import com.evolveum.midpoint.web.component.data.MenuMultiButtonPanel;
Expand All @@ -19,7 +18,6 @@
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction;

import org.apache.commons.lang.BooleanUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
Expand Down Expand Up @@ -187,7 +185,7 @@ public void yesPerformed(AjaxRequestTarget target) {
// }

public String getButtonSizeCssClass() {
return DoubleButtonColumn.BUTTON_SIZE_CLASS.EXTRA_SMALL.toString();
return DoubleButtonColumn.ButtonSizeClass.EXTRA_SMALL.toString();
}

private String getButtonCssClass() {
Expand Down
Expand Up @@ -80,11 +80,11 @@ public boolean isVisible(IModel<T> model){
public void clickPerformed(AjaxRequestTarget target, IModel<T> model){}

public String getButtonCssSizeClass(){
return DoubleButtonColumn.BUTTON_SIZE_CLASS.SMALL.toString();
return DoubleButtonColumn.ButtonSizeClass.SMALL.toString();
}

public String getButtonCssColorClass(){
return DoubleButtonColumn.BUTTON_COLOR_CLASS.DEFAULT.toString();
return DoubleButtonColumn.ButtonColorClass.DEFAULT.toString();
}

public String getCaption(){
Expand Down
Expand Up @@ -28,7 +28,7 @@
*/
public class NavigatorPanel extends Panel {

private int PAGING_SIZE = 5;
private static final int PAGING_SIZE = 5;

private static final String ID_PREVIOUS = "previous";
private static final String ID_PREVIOUS_LINK = "previousLink";
Expand Down
Expand Up @@ -34,11 +34,11 @@
@Deprecated
public class InlineMenu extends BasePanel<List<InlineMenuItem>> {

private static String ID_MENU_ITEM_CONTAINER= "menuItemContainer";
private static String ID_MENU_ITEM_BUTTON = "menuItemButton";
private static String ID_MENU_ITEM = "menuItem";
private static String ID_MENU_ITEM_BODY = "menuItemBody";
private static String ID_MENU_ITEM_ICON = "menuItemIcon";
private static final String ID_MENU_ITEM_CONTAINER= "menuItemContainer";
private static final String ID_MENU_ITEM_BUTTON = "menuItemButton";
private static final String ID_MENU_ITEM = "menuItem";
private static final String ID_MENU_ITEM_BODY = "menuItemBody";
private static final String ID_MENU_ITEM_ICON = "menuItemIcon";

private boolean hideByDefault;

Expand Down
Expand Up @@ -16,7 +16,7 @@
*/
public class MenuDividerPanel extends Panel {

private static String ID_MENU_ITEM_LABEL = "menuItemLabel";
private static final String ID_MENU_ITEM_LABEL = "menuItemLabel";

public MenuDividerPanel(String id, IModel<InlineMenuItem> item) {
super(id);
Expand Down
Expand Up @@ -30,8 +30,8 @@
*/
public class MenuLinkPanel extends Panel {

private static String ID_MENU_ITEM_LINK = "menuItemLink";
private static String ID_MENU_ITEM_LABEL = "menuItemLabel";
private static final String ID_MENU_ITEM_LINK = "menuItemLink";
private static final String ID_MENU_ITEM_LABEL = "menuItemLabel";

public MenuLinkPanel(String id, IModel<InlineMenuItem> item) {
super(id);
Expand Down
Expand Up @@ -6,21 +6,14 @@
*/
package com.evolveum.midpoint.web.component.objectdetails;

import org.apache.wicket.markup.html.WebMarkupContainer;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.prism.PrismObjectWrapper;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.prism.PrismObjectWrapper;
import com.evolveum.midpoint.web.component.assignment.SwitchAssignmentTypePanel;
import com.evolveum.midpoint.web.component.form.Form;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;

import com.evolveum.midpoint.web.component.prism.*;
import com.evolveum.midpoint.web.model.ContainerWrapperFromObjectWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.Model;

Expand Down

0 comments on commit f718fa8

Please sign in to comment.