提交 4b157b39 编写于 作者: F frederikheremans

ACT-754: Cleaned up styles.css (all old and new is merged)

上级 8db32354
......@@ -81,24 +81,14 @@ public interface ExplorerLayout {
// Login page
static final String STYLE_LOGIN_PAGE = "login-general";
// Menu bar
static final String STYLE_MENUBAR = "menubar";
static final String STYLE_MENUBAR_BUTTON = "menu-button";
// Action Bar
static final String STYLE_ACTION_BAR = "action-bar";
// Profile page
static final String STYLE_PROFILE_LAYOUT = "profile-layout";
static final String STYLE_PROFILE_HEADER = "profile-header";
static final String STYLE_PROFILE_FIELD = "profile-field";
static final String STYLE_PROFILE_PICTURE = "profile-picture";
static final String STYLE_PROFILE_LINK = "profile-link";
// Task pages
static final String STYLE_TASK_LIST = "task-list";
static final String STYLE_TASK_DETAILS = "task-details";
static final String STYLE_TASK_DETAILS_HEADER = "task-details-header";
static final String STYLE_TASK_EVENT_PANEL = "task-event-panel";
static final String STYLE_TASK_EVENT = "task-event";
static final String STYLE_TASK_EVENT_AUTHOR = "task-event-author";
......@@ -111,6 +101,7 @@ public interface ExplorerLayout {
static final String STYLE_TASK_HEADER_PRIORITY_HIGH = "task-priority-high";
static final String STYLE_TASK_HEADER_CREATE_TIME = "task-create-time";
static final String STYLE_INVOLVE_PEOPLE = "involve-people";
static final String STYLE_TASK_SUBTASKS_LIST = "subtasks";
// Flow pages
static final String STYLE_PROCESS_DEFINITION_LIST = "proc-def-list";
......@@ -121,8 +112,8 @@ public interface ExplorerLayout {
static final String STYLE_FLOW_HEADER_START_TIME = "flow-start-time";
// Database page
static final String STYLE_DATABASE_DETAILS = "database-details";
static final String STYLE_DATABASE_TABLE_ROW = "database-table-row";
static final String STYLE_DATABASE_TABLE = "database-table";
// Deployment page
static final String STYLE_DEPLOYMENT_UPLOAD_DESCRIPTION = "upload-description";
......
......@@ -26,7 +26,6 @@ public class Images {
// General
public static final Resource WHITE_DIVIDER = new ThemeResource("img/divider-white.png");
public static final Resource TASK = new ThemeResource("img/task-22.png");
public static final Resource CLOCK = new ThemeResource("img/clock.png");
public static final Resource PROCESS_48PX = new ThemeResource("img/process_48.png");
public static final Resource RESOURCE = new ThemeResource("img/resource.png");
......@@ -45,11 +44,11 @@ public class Images {
public static final Resource MAIN_MENU_REPORTS = new ThemeResource("img/mm-reports.png");
// Task
public static final Resource TASK_16 = new ThemeResource("img/task-16.png");;
public static final Resource TASK_22 = new ThemeResource("img/task-22.png");
public static final Resource TASK_50 = new ThemeResource("img/task-50.png");
public static final Resource TASK_FINISHED = new ThemeResource("img/tick.png");
public static final Resource TASK_UNFINISHED = new ThemeResource("img/control_play.png");
public static final Resource TASK_FINISHED_22 = new ThemeResource("img/task-finished-22.png");
public static final Resource TASK_DUE_DATE_16 = new ThemeResource("img/duedate-16.png");
public static final Resource TASK_16 = new ThemeResource("img/task-16.png");;
// Accounts
public static final Resource SKYPE = new ThemeResource("img/skype.png");
......
/* 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 org.activiti.explorer.ui;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.themes.Reindeer;
/**
* @author Joram Barrez
*/
public class MenuBar extends HorizontalLayout {
private static final long serialVersionUID = 5643382350306433838L;
public MenuBar() {
setSpacing(true);
setWidth("100%");
}
protected Button createMenuBarButton(String name) {
Button button = new Button(name);
button.addStyleName(Reindeer.BUTTON_LINK);
button.addStyleName(ExplorerLayout.STYLE_MENUBAR_BUTTON);
addComponent(button);
return button;
}
protected void fillRemainingSpace() {
Label remainingSpace = new Label();
remainingSpace.setWidth("100%");
addComponent(remainingSpace);
setExpandRatio(remainingSpace, 1.0f);
}
}
......@@ -88,7 +88,7 @@ public class FileAttachmentEditorComponent extends VerticalLayout implements Att
protected void initSuccessIndicator() {
successIndicator = new Label();
successIndicator.setIcon(Images.TASK_FINISHED);
successIndicator.setIcon(Images.SUCCESS);
successIndicator.setVisible(false);
addComponent(successIndicator);
......
......@@ -52,8 +52,9 @@ public class UploadPopupWindow extends PopupWindow {
// UI initialisation ----------------------------------------------------------------------------
protected void init(String caption, String description, Receiver receiver) {
initWindow(caption);
uploadComponent = new UploadComponent(description, receiver);
uploadComponent.setSizeFull();
initWindow(caption);
}
protected void initWindow(String caption) {
......
......@@ -156,9 +156,9 @@ public class ProcessInstanceDetailPanel extends DetailPanel {
Item item = taskTable.addItem(task.getId());
if(task.getEndTime() != null) {
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_FINISHED));
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_22));
} else {
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_UNFINISHED));
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_FINISHED_22));
}
item.getItemProperty("name").setValue(task.getName());
......
......@@ -103,8 +103,7 @@ public class DatabaseDetailPanel extends DetailPanel {
data.setWidth(100, UNITS_PERCENTAGE);
data.setHeight(100, UNITS_PERCENTAGE);
data.addStyleName(ExplorerLayout.STYLE_DATABASE_TABLE_ROW);
data.addStyleName(ExplorerLayout.STYLE_DATABASE_DETAILS);
data.addStyleName(ExplorerLayout.STYLE_DATABASE_TABLE);
setDetailExpandRatio(data, 1.0f);
// Create column headers
......@@ -115,7 +114,7 @@ public class DatabaseDetailPanel extends DetailPanel {
} else {
Label noDataLabel = new Label(i18nManager.getMessage(Messages.DATABASE_NO_ROWS));
noDataLabel.addStyleName(ExplorerLayout.STYLE_DATABASE_DETAILS);
noDataLabel.addStyleName(Reindeer.LABEL_SMALL);
addDetailComponent(noDataLabel);
setDetailExpandRatio(noDataLabel, 1.0f);
}
......
......@@ -278,7 +278,7 @@ public class HistoricTaskDetailPanel extends DetailPanel {
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
for (final HistoricTaskInstance subTask : subTasks) {
// icon
Embedded icon = new Embedded(null, Images.TASK);
Embedded icon = new Embedded(null, Images.TASK_22);
icon.setWidth(22, UNITS_PIXELS);
icon.setWidth(22, UNITS_PIXELS);
subTaskGrid.addComponent(icon);
......
......@@ -14,8 +14,10 @@ package org.activiti.explorer.ui.task;
import java.util.List;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.task.Task;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.I18nManager;
......@@ -28,10 +30,10 @@ import org.activiti.explorer.ui.task.listener.DeleteSubTaskClickListener;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
......@@ -55,6 +57,7 @@ public class SubTaskComponent extends CustomComponent {
protected I18nManager i18nManager;
protected TaskService taskService;
protected HistoryService historyService;
protected Task parentTask;
protected TaskDetailPanel taskDetailPanel;
......@@ -69,6 +72,7 @@ public class SubTaskComponent extends CustomComponent {
this.parentTask = parentTask;
this.i18nManager = ExplorerApp.get().getI18nManager();
this.taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
this.historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService();
initUi();
}
......@@ -187,7 +191,9 @@ public class SubTaskComponent extends CustomComponent {
}
protected void initSubTasks() {
List<Task> subTasks = taskService.getSubTasks(parentTask.getId());
List<HistoricTaskInstance> subTasks = historyService.createHistoricTaskInstanceQuery()
.taskParentTaskId(parentTask.getId())
.list();
initSubTasksLayout();
populateSubTasks(subTasks);
}
......@@ -195,16 +201,24 @@ public class SubTaskComponent extends CustomComponent {
protected void initSubTasksLayout() {
subTaskLayout = new GridLayout();
subTaskLayout.setColumns(3);
subTaskLayout.addStyleName(ExplorerLayout.STYLE_TASK_SUBTASKS_LIST);
subTaskLayout.setWidth(99, UNITS_PERCENTAGE);
subTaskLayout.setColumnExpandRatio(2, 1.0f);
subTaskLayout.setSpacing(true);
layout.addComponent(subTaskLayout);
}
protected void populateSubTasks(List<Task> subTasks) {
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
if (subTasks.size() > 0) {
for (final Task subTask : subTasks) {
for (final HistoricTaskInstance subTask : subTasks) {
// icon
Embedded icon = new Embedded(null, Images.TASK);
Embedded icon = null;
if(subTask.getEndTime() != null) {
icon = new Embedded(null, Images.TASK_FINISHED_22);
} else {
icon = new Embedded(null, Images.TASK_22);
}
icon.setWidth(22, UNITS_PIXELS);
icon.setWidth(22, UNITS_PIXELS);
subTaskLayout.addComponent(icon);
......@@ -220,12 +234,17 @@ public class SubTaskComponent extends CustomComponent {
subTaskLayout.addComponent(subTaskLink);
subTaskLayout.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT);
// Delete icon
if(subTask.getEndTime() == null) {
// Delete icon only appears when task is not finished yet
Embedded deleteIcon = new Embedded(null, Images.DELETE);
deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteIcon.addListener(new DeleteSubTaskClickListener(subTask, this));
subTaskLayout.addComponent(deleteIcon);
subTaskLayout.setComponentAlignment(deleteIcon, Alignment.MIDDLE_RIGHT);
} else {
// Next line of grid
subTaskLayout.newLine();
}
}
} else {
Label noSubTasksLabel = new Label(i18nManager.getMessage(Messages.TASK_NO_SUBTASKS));
......@@ -238,7 +257,9 @@ public class SubTaskComponent extends CustomComponent {
public void refreshSubTasks() {
subTaskLayout.removeAllComponents();
List<Task> subTasks = taskService.getSubTasks(parentTask.getId());
List<HistoricTaskInstance> subTasks = historyService.createHistoricTaskInstanceQuery()
.taskParentTaskId(parentTask.getId())
.list();
populateSubTasks(subTasks);
}
......
......@@ -95,7 +95,7 @@ public abstract class TaskPage extends AbstractPage {
taskTable.setContainerDataSource(taskListContainer);
// Create column header
taskTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.TASK));
taskTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.TASK_22));
taskTable.setColumnWidth("icon", 22);
taskTable.addContainerProperty("name", String.class, null);
......
......@@ -15,7 +15,7 @@ package org.activiti.explorer.ui.task.listener;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.explorer.ExplorerApp;
import org.activiti.explorer.I18nManager;
import org.activiti.explorer.Messages;
......@@ -39,10 +39,10 @@ public class DeleteSubTaskClickListener implements ClickListener {
private static final long serialVersionUID = 1L;
protected Task subTask;
protected HistoricTaskInstance subTask;
protected SubTaskComponent subTaskComponent;
public DeleteSubTaskClickListener(Task subTask, SubTaskComponent subTaskComponent) {
public DeleteSubTaskClickListener(HistoricTaskInstance subTask, SubTaskComponent subTaskComponent) {
this.subTask = subTask;
this.subTaskComponent = subTaskComponent;
}
......@@ -55,6 +55,7 @@ public class DeleteSubTaskClickListener implements ClickListener {
ConfirmationDialogPopupWindow popup = new ConfirmationDialogPopupWindow(
i18nManager.getMessage(Messages.TASK_CONFIRM_DELETE_SUBTASK, subTask.getName()));
popup.addListener(new ConfirmationEventListener() {
private static final long serialVersionUID = 1L;
protected void rejected(ConfirmationEvent event) {
}
protected void confirmed(ConfirmationEvent event) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册