Browse Source

bug fix AOP实现提醒功能

master
XiaXiang 8 years ago
parent
commit
b23769e111
  1. 8
      designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj
  2. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  3. 23
      designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj
  4. 11
      designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj
  5. 6
      designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj
  6. 6
      designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj

8
designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj

@ -35,7 +35,7 @@ public aspect TemplateProcessTracker {
// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
before(ActionEvent e) : onActionPerformed(e) {
@ -47,7 +47,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
@ -56,7 +56,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c);
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
@ -66,7 +66,7 @@ public aspect TemplateProcessTracker {
// String v = "test";
//String log = String.format("%s:\n%s\nset value: %s at %s\n\n", new Date(), sl, v, g.getEditingCellElement());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -30,9 +30,9 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
}
@Override
public synchronized SearchResult getLessSearchResult(String searchText) {
this.modelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isContainRecommend()) {
String result;
this.modelList = new SearchResult();
HttpClient httpClient = new HttpClient(SEARCHAPI + CodeUtils.cjkEncode(searchText));
httpClient.asGet();
httpClient.setTimeout(5000);

23
designer_base/src/com/fr/aspectj/designerbase/AlphaFineReminder.aj

@ -0,0 +1,23 @@
package com.fr.aspectj.designerbase;
import java.awt.event.ActionEvent;
/**
* Created by XiaXiang on 2017/5/25.
*/
public aspect AlphaFineReminder {
pointcut onActionPerformed(ActionEvent e) :
execution(* actionPerformed(ActionEvent)) && args(e);
before(ActionEvent e) : onActionPerformed(e) {
String point = thisJoinPoint.toString();
if (e != null && e.getSource().toString().contains("javax.swing.Timer")) {
return;
}
if (e != null && e.getSource().getClass().getName().equals("com.fr.design.gui.imenu.UIMenuItem") && point.contains("com.fr.design.actions")) {
System.out.print("在点击菜单\n" + thisJoinPoint);
}
}
}

11
designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj

@ -32,19 +32,22 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
before(ActionEvent e) : onActionPerformed(e) {
SourceLocation sl = thisJoinPoint.getSourceLocation();
// !within(LogHandlerBar) 没用, 手动过滤
if (e.getSource().toString().contains("javax.swing.Timer")) {
if (e != null && e.getSource().toString().contains("javax.swing.Timer")) {
return;
}
if (e != null && e.getSource().getClass().getName().equals("com.fr.design.gui.imenu.UIMenuItem")) {
System.out.print("在点击菜单\n" + thisJoinPointStaticPart.getSourceLocation() + thisJoinPoint);
}
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
@ -53,7 +56,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c);
String log = "";
TemplateInfoCollector.appendProcess(log);
// TemplateInfoCollector.appendProcess(log);
}

6
designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj

@ -32,7 +32,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
before(ActionEvent e) : onActionPerformed(e) {
@ -44,7 +44,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
@ -52,7 +52,7 @@ public aspect TemplateProcessTracker {
SourceLocation sl = thisJoinPoint.getSourceLocation();
//String log = String.format("%s:\n%s\n插入新图表:%s\n\n", new Date(), sl, c.getChartName());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}

6
designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj

@ -30,7 +30,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
before(ActionEvent e) : onActionPerformed(e) {
@ -42,7 +42,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource());
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}
//同上
@ -51,7 +51,7 @@ public aspect TemplateProcessTracker {
//String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c);
String log = "";
TemplateInfoCollector.appendProcess(log);
//TemplateInfoCollector.appendProcess(log);
}

Loading…
Cancel
Save