Browse Source

规范代码,允许通过GeneralContext注册插件监听

master
juhaoyu 8 years ago
parent
commit
89a2d4d08b
  1. 4
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  2. 3
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  3. 5
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java
  4. 8
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 4
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

4
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -27,6 +27,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.context.PluginContext;
@ -34,7 +35,6 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
@ -88,7 +88,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
createAddMenuDef();
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
@Override
public void on(PluginEvent event) {

3
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -40,7 +40,6 @@ import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
@ -175,7 +174,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {

5
designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java

@ -5,12 +5,11 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.icontainer.UIResizableContainer;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerPriority;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.Constants;
public class WestRegionContainerPane extends UIResizableContainer {
@ -35,7 +34,7 @@ public class WestRegionContainerPane extends UIResizableContainer {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) {
GeneralContext.listenPluginRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) {
@Override
public void on(PluginEvent event) {

8
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -31,6 +31,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime;
@ -38,7 +39,6 @@ import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
@ -595,8 +595,8 @@ public abstract class ToolBarMenuDock {
return context.contain(MenuHandler.MARK_STRING);
}
};
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeStop, new PluginEventListener() {
GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
@ -605,7 +605,7 @@ public abstract class ToolBarMenuDock {
removeExtraMenus(menuDef, anchor, action, menuHandlers);
}
}, filter);
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() {
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
@Override
public void on(PluginEvent event) {

4
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -20,6 +20,7 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext;
@ -28,7 +29,6 @@ import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
@ -61,7 +61,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
static {
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {

Loading…
Cancel
Save