Browse Source

继续移植插件监听

master
juhaoyu 8 years ago
parent
commit
1f70c2dd16
  1. 2
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  2. 23
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  3. 77
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  4. 26
      designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java
  5. 21
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

2
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -40,7 +40,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
}
static {
StableFactory.registerMarkedObject(PluginModule.EXTRA_DESIGN.getAgentName(), classManager);
StableFactory.registerMarkedObject(PluginModule.ExtraDesign.getAgentName(), classManager);
}
public TableDataNameObjectCreator[] getReportTableDataCreators() {

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

@ -14,6 +14,7 @@ import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.TableDataDefineProvider;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -29,6 +30,13 @@ 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;
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.PluginListenerPriority;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.plugin.PluginReadListener;
@ -81,13 +89,22 @@ public class TableDataTreePane extends BasicTableDataTreePane {
addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH);
createAddMenuDef();
GeneralContext.addPluginReadListener(new PluginReadListener() {
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener(PluginListenerPriority.TableDataTreePane) {
@Override
public void success(Status status) {
public void on(PluginEvent event) {
addMenuDef.clearShortCuts();
createAddMenuDef();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign, TableDataDefineProvider.XML_TAG);
}
});
editAction = new EditAction();

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

@ -15,11 +15,7 @@ import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.file.*;
import com.fr.design.fun.TitlePlaceProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight;
@ -40,12 +36,16 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
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;
import com.fr.stable.StableUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.plugin.PluginReadListener;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
@ -53,20 +53,8 @@ import javax.swing.border.MatteBorder;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.dnd.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@ -186,26 +174,43 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() {
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() {
@Override
public void success(Status status) {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(TitlePlaceProcessor.MARK_STRING);
}
});
if (DesignerEnvManager.getEnvManager().getAlphafineConfigManager().isEnabled()) {
northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER);
}
return northEastPane;
}
public DesignerFrame(ToolBarMenuDock ad) {
setName(DESIGNER_FRAME_NAME);
this.ad = ad;
northEastPane.add(ad.createAlphafinePane(), BorderLayout.CENTER);
}
refreshNorthEastPane(northEastPane, ad);
return northEastPane;
}
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
}
public DesignerFrame(ToolBarMenuDock ad) {
setName(DESIGNER_FRAME_NAME);
this.ad = ad;
this.initTitleIcon();
this.setTitle();// james:因为有默认的了
// set this to context.

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

@ -3,10 +3,15 @@ package com.fr.design.mainframe;
import com.fr.design.DesignModelAdapter;
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;
import com.fr.stable.plugin.PluginReadListener;
public class WestRegionContainerPane extends UIResizableContainer {
@ -27,12 +32,25 @@ public class WestRegionContainerPane extends UIResizableContainer {
public WestRegionContainerPane() {
super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT);
GeneralContext.addPluginReadListener(new PluginReadListener() {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener(PluginListenerPriority.WestRegionContainerPane) {
@Override
public void success(Status status) {
public void on(PluginEvent event) {
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(TableDataPaneProcessor.XML_TAG);
}
});
setContainerWidth(165);
}
}

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

@ -23,7 +23,13 @@ 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;
import com.fr.plugin.injectable.PluginModule;
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;
@ -55,15 +61,22 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
StableFactory.registerMarkedObject(XML_TAG, classManager);
}
// TODO: 2017/3/8
static {
GeneralContext.addPluginReadListener(new PluginReadListener() {
PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() {
@Override
public void success() {
public void on(PluginEvent event) {
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraChartType);
}
});
}

Loading…
Cancel
Save