Browse Source

Merge pull request #24 in PF/design from ~JU/co-pf-9.0-design:9.0 to 9.0

* commit '2461248e116f5c7782f407d19cdf4878a74bdc50':
  规范代码,允许通过GeneralContext注册插件监听
master
superman 8 years ago
parent
commit
a87f3f336c
  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. 6
      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.SeparatorDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.context.PluginContext; 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.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*; import javax.swing.*;
@ -88,7 +88,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
createAddMenuDef(); createAddMenuDef();
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
@Override @Override
public void on(PluginEvent event) { 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.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
@ -175,7 +174,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//顶部日志+登陆按钮 //顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { 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.data.datapane.TableDataTreePane;
import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.icontainer.UIResizableContainer; import com.fr.design.gui.icontainer.UIResizableContainer;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerPriority;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.Constants; import com.fr.stable.Constants;
public class WestRegionContainerPane extends UIResizableContainer { public class WestRegionContainerPane extends UIResizableContainer {
@ -35,7 +34,7 @@ public class WestRegionContainerPane extends UIResizableContainer {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); 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 @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {

6
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.design.menu.ToolBarDef;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime; 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.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginEventType;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
@ -596,7 +596,7 @@ public abstract class ToolBarMenuDock {
} }
}; };
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeStop, new PluginEventListener() { GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
@ -605,7 +605,7 @@ public abstract class ToolBarMenuDock {
removeExtraMenus(menuDef, anchor, action, menuHandlers); removeExtraMenus(menuDef, anchor, action, menuHandlers);
} }
}, filter); }, filter);
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() { GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { 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.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext; 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.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
@ -61,7 +61,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
static { static {
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {

Loading…
Cancel
Save