Skip to content

Commit

Permalink
Object colors, GUI Style constants
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 11, 2016
1 parent da4a1c8 commit e9b8533
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 49 deletions.
@@ -0,0 +1,42 @@
/**
* Copyright (c) 2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.gui.api;

/**
* @author semancik
*
*/
public class GuiStyleConstants {

public static final String STYLES_OBJECT_USER_ICON = "fa fa-user";
public static final String STYLES_OBJECT_USER_ICON_COLORED = STYLES_OBJECT_USER_ICON + " object-user-color";

public static final String STYLES_OBJECT_ROLE_ICON = "fa fa-street-view";
public static final String STYLES_OBJECT_ROLE_ICON_COLORED = STYLES_OBJECT_ROLE_ICON + " object-role-color";

public static final String STYLES_OBJECT_ORG_ICON = "fa fa-building";
public static final String STYLES_OBJECT_ORG_ICON_COLORED = STYLES_OBJECT_ORG_ICON + " object-org-color";

public static final String STYLES_OBJECT_SERVICE_ICON = "fa fa-cloud";
public static final String STYLES_OBJECT_SERVICE_ICON_COLORED = STYLES_OBJECT_SERVICE_ICON + " object-service-color";

public static final String STYLES_OBJECT_RESOURCE_ICON = "fa fa-laptop";
public static final String STYLES_OBJECT_RESOURCE_ICON_COLORED = STYLES_OBJECT_RESOURCE_ICON + " object-resource-color";

public static final String STYLES_OBJECT_TASK_ICON = "fa fa-tasks";
public static final String STYLES_OBJECT_TASK_ICON_COLORED = STYLES_OBJECT_TASK_ICON;

}
Expand Up @@ -22,6 +22,7 @@
import com.evolveum.midpoint.common.validator.EventHandler;
import com.evolveum.midpoint.common.validator.EventResult;
import com.evolveum.midpoint.common.validator.Validator;
import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.component.result.OpResult;
import com.evolveum.midpoint.gui.api.util.ModelServiceLocator;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
Expand Down Expand Up @@ -1000,7 +1001,7 @@ private MainMenuItem createWorkItemsItems() {
}

private MainMenuItem createServerTasksItems() {
MainMenuItem item = new MainMenuItem("fa fa-tasks", createStringResource("PageAdmin.menu.top.serverTasks"),
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_TASK_ICON_COLORED, createStringResource("PageAdmin.menu.top.serverTasks"),
null);

List<MenuItem> submenu = item.getItems();
Expand All @@ -1018,7 +1019,7 @@ private MainMenuItem createServerTasksItems() {
}

private MainMenuItem createResourcesItems() {
MainMenuItem item = new MainMenuItem("fa fa-laptop", createStringResource("PageAdmin.menu.top.resources"),
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_RESOURCE_ICON_COLORED, createStringResource("PageAdmin.menu.top.resources"),
null);

List<MenuItem> submenu = item.getItems();
Expand Down Expand Up @@ -1278,7 +1279,7 @@ private MainMenuItem createHomeItems() {
}

private MainMenuItem createUsersItems() {
MainMenuItem item = new MainMenuItem("fa fa-group", createStringResource("PageAdmin.menu.top.users"), null);
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_USER_ICON_COLORED, createStringResource("PageAdmin.menu.top.users"), null);

List<MenuItem> submenu = item.getItems();

Expand Down Expand Up @@ -1365,7 +1366,7 @@ public boolean isVisible() {
}

private MainMenuItem createOrganizationsMenu() {
MainMenuItem item = new MainMenuItem("fa fa-building", createStringResource("PageAdmin.menu.top.users.org"),
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_ORG_ICON_COLORED, createStringResource("PageAdmin.menu.top.users.org"),
null);

List<MenuItem> submenu = item.getItems();
Expand All @@ -1379,7 +1380,7 @@ private MainMenuItem createOrganizationsMenu() {
}

private MainMenuItem createRolesItems() {
MainMenuItem item = new MainMenuItem("fa fa-street-view", createStringResource("PageAdmin.menu.top.roles"),
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_ROLE_ICON_COLORED, createStringResource("PageAdmin.menu.top.roles"),
null);

List<MenuItem> submenu = item.getItems();
Expand All @@ -1393,7 +1394,7 @@ private MainMenuItem createRolesItems() {
}

private MainMenuItem createServicesItems() {
MainMenuItem item = new MainMenuItem("fa fa-street-view", createStringResource("PageAdmin.menu.top.services"),
MainMenuItem item = new MainMenuItem(GuiStyleConstants.STYLES_OBJECT_SERVICE_ICON_COLORED, createStringResource("PageAdmin.menu.top.services"),
null);

List<MenuItem> submenu = item.getItems();
Expand Down
@@ -1,3 +1,18 @@
/**
* Copyright (c) 2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.web.component;

import com.evolveum.midpoint.prism.PrismObject;
Expand Down
@@ -1,3 +1,18 @@
/**
* Copyright (c) 2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.web.page.admin.resources;

import javax.xml.namespace.QName;
Expand All @@ -8,12 +23,14 @@
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.util.ResourceTypeUtil;
import com.evolveum.midpoint.web.component.ObjectSummaryPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;

public class ResourceSummaryPanel extends ObjectSummaryPanel<ResourceType>{
private static final long serialVersionUID = 1L;

public ResourceSummaryPanel(String id, IModel<PrismObject<ResourceType>> model) {
super(id, model);
Expand All @@ -25,7 +42,7 @@ public ResourceSummaryPanel(String id, IModel<PrismObject<ResourceType>> model)

@Override
protected String getIconCssClass() {
return "fa fa-laptop";
return GuiStyleConstants.STYLES_OBJECT_RESOURCE_ICON;
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 Evolveum
* Copyright (c) 2015-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.web.component.FocusSummaryPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;

Expand All @@ -45,7 +46,7 @@ protected QName getTitlePropertyName() {

@Override
protected String getIconCssClass() {
return "fa fa-street-view";
return GuiStyleConstants.STYLES_OBJECT_ROLE_ICON;
}

@Override
Expand Down
Expand Up @@ -15,6 +15,7 @@
*/
package com.evolveum.midpoint.web.page.admin.server;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.PrismObject;
Expand Down Expand Up @@ -155,17 +156,17 @@ protected QName getDisplayNamePropertyName() {

@Override
protected String getIconCssClass() {
return "fa fa-tasks";
return GuiStyleConstants.STYLES_OBJECT_TASK_ICON;
}

@Override
protected String getIconBoxAdditionalCssClass() { // TODO
return "summary-panel-resource";
return "summary-panel-task";
}

@Override
protected String getBoxAdditionalCssClass() { // TODO
return "summary-panel-resource";
return "summary-panel-task";
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 Evolveum
* Copyright (c) 2015-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.web.component.FocusSummaryPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;

Expand All @@ -31,7 +32,6 @@ public class OrgSummaryPanel extends FocusSummaryPanel<OrgType> {

public OrgSummaryPanel(String id, IModel model) {
super(id, model);
// TODO Auto-generated constructor stub
}

@Override
Expand All @@ -46,7 +46,7 @@ protected QName getTitlePropertyName() {

@Override
protected String getIconCssClass() {
return "fa fa-building";
return GuiStyleConstants.STYLES_OBJECT_SERVICE_ICON;
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 Evolveum
* Copyright (c) 2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,45 +19,45 @@

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.web.component.FocusSummaryPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType;

/**
* @author semancik
* @author katkav
*
*/
public class ServiceSummaryPanel extends FocusSummaryPanel<ServiceType> {
private static final long serialVersionUID = -5457446213855746564L;

public ServiceSummaryPanel(String id, IModel model) {
super(id, model);
// TODO Auto-generated constructor stub
}

@Override
protected QName getDisplayNamePropertyName() {
return OrgType.F_DISPLAY_NAME;
return ServiceType.F_DISPLAY_NAME;
}

@Override
protected QName getTitlePropertyName() {
return OrgType.F_IDENTIFIER;
return ServiceType.F_IDENTIFIER;
}

@Override
protected String getIconCssClass() {
return "fa fa-building";
return GuiStyleConstants.STYLES_OBJECT_SERVICE_ICON;
}

@Override
protected String getIconBoxAdditionalCssClass() {
return "summary-panel-org";
return "summary-panel-service";
}

@Override
protected String getBoxAdditionalCssClass() {
return "summary-panel-org";
return "summary-panel-service";
}

}
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 Evolveum
* Copyright (c) 2015-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.web.component.FocusSummaryPanel;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.util.SummaryTag;
Expand Down Expand Up @@ -89,7 +90,7 @@ protected QName getTitlePropertyName() {

@Override
protected String getIconCssClass() {
return "fa fa-user";
return GuiStyleConstants.STYLES_OBJECT_USER_ICON;
}

@Override
Expand Down

0 comments on commit e9b8533

Please sign in to comment.