|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.fr.startup.metric; |
|
|
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.start.common.DesignerStartupContext; |
|
|
|
|
import com.fr.startup.ui.StartupPageModel; |
|
|
|
|
import com.fr.startup.ui.StartupWorkspaceBean; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayDeque; |
|
|
|
|
import java.util.Deque; |
|
|
|
@ -15,6 +17,9 @@ public class DesignerStartupPageStatistic {
|
|
|
|
|
|
|
|
|
|
private final Deque<Operation> operations = new ArrayDeque<>(); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 见 {@link OperationType} 的注释 |
|
|
|
|
*/ |
|
|
|
|
public void recordOpenEmptyTemplate() { |
|
|
|
|
|
|
|
|
|
Operation operation = OperationType.DO_OPEN_EMPTY_TEMPLATE.create(); |
|
|
|
@ -24,15 +29,24 @@ public class DesignerStartupPageStatistic {
|
|
|
|
|
pushOperation(operation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void recordSwitchWorkspace() { |
|
|
|
|
/** |
|
|
|
|
* 见 {@link OperationType} 的注释 |
|
|
|
|
*/ |
|
|
|
|
public void recordSwitchWorkspace(StartupWorkspaceBean lastWorkspaceInfo, StartupWorkspaceBean currentWorkspace) { |
|
|
|
|
|
|
|
|
|
if (lastWorkspaceInfo != null && StringUtils.equals(lastWorkspaceInfo.getName(), currentWorkspace.getName())) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
Operation operation = OperationType.DO_SWITCH_WORKSPACE.create(); |
|
|
|
|
StartupPageModel pageModel = DesignerStartupContext.getInstance().getStartupPageModel(); |
|
|
|
|
operation.setWorkspace(pageModel.getSelectWorkspaceInfo().getName()); |
|
|
|
|
operation.setWorkspace(currentWorkspace.getName()); |
|
|
|
|
operation.setWorkspaceNum(pageModel.getWorkspaceInfos().size()); |
|
|
|
|
pushOperation(operation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 见 {@link OperationType} 的注释 |
|
|
|
|
*/ |
|
|
|
|
public void recordShowAllAction() { |
|
|
|
|
|
|
|
|
|
Operation operation = OperationType.DO_SHOW_ALL_ACTION.create(); |
|
|
|
@ -41,6 +55,9 @@ public class DesignerStartupPageStatistic {
|
|
|
|
|
pushOperation(operation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 见 {@link OperationType} 的注释 |
|
|
|
|
*/ |
|
|
|
|
public void recordOpenLastTemplate(String lastOpenFile) { |
|
|
|
|
|
|
|
|
|
Operation operation = OperationType.DO_OPEN_LAST_TEMPLATE_ACTION.create(); |
|
|
|
@ -50,11 +67,21 @@ public class DesignerStartupPageStatistic {
|
|
|
|
|
pushOperation(operation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加操作 |
|
|
|
|
* |
|
|
|
|
* @param operation 操作 |
|
|
|
|
*/ |
|
|
|
|
public void pushOperation(Operation operation) { |
|
|
|
|
|
|
|
|
|
this.operations.push(operation); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取操作 |
|
|
|
|
* |
|
|
|
|
* @return 操作 |
|
|
|
|
*/ |
|
|
|
|
public Deque<Operation> getOperations() { |
|
|
|
|
|
|
|
|
|
return this.operations; |
|
|
|
|