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