Browse Source

REPORT-51163 插件监听的代码丢了

research/11.0
rinoux 4 years ago
parent
commit
0551a2c472
  1. 28
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

28
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -44,9 +44,15 @@ import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.esd.query.StrategicTableData;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
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.stable.core.PropertyChangeAdapter;
import org.jetbrains.annotations.NotNull;
@ -120,6 +126,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
addMenuDef = new MenuDef(Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH);
createAddMenuDef();
// 创建插件监听
createPluginListener();
editAction = new EditAction();
removeAction = new RemoveAction();
@ -165,6 +173,26 @@ public class TableDataTreePane extends BasicTableDataTreePane {
checkButtonEnabled();
}
private void createPluginListener() {
//菜单栏监听
GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
@Override
public void on(PluginEvent event) {
addMenuDef.clearShortCuts();
createAddMenuDef();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
}
/**
* 刷新
*/

Loading…
Cancel
Save