From 25b278e3c01633fbcc56ab299450d258d717a769 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 17:35:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>=E5=8E=BB=E6=8E=89=E5=86=97?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/EventPropertyTable.java | 73 ------------------- 1 file changed, 73 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index 41057748fc..435f42cfe6 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -1,17 +1,11 @@ package com.fr.design.designer.properties; -import com.fr.design.actions.UpdateAction; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; import com.fr.design.widget.EventCreator; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -21,19 +15,14 @@ import com.fr.design.form.javascript.FormEmailPane; import com.fr.form.ui.Widget; import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.js.JavaScriptImpl; import com.fr.stable.Nameable; import javax.swing.*; -import java.awt.event.ActionEvent; import java.util.ArrayList; public class EventPropertyTable extends UIListControlPane { - private ShortCut[] shorts; private XCreator creator; - private ToolBarDef toolbarDef; - private UIToolbar toolbar; private FormDesigner designer; public EventPropertyTable(FormDesigner designer) { @@ -46,40 +35,11 @@ public class EventPropertyTable extends UIListControlPane { return Inter.getLocText("FR-Designer_Add_Event"); } - @Override - protected void initComponentPane() { - toolbarDef = new ToolBarDef(); - shorts = new ShortCut[] {new AddItemMenuDef()}; - for (ShortCut sj : shorts) { - toolbarDef.addShortCut(sj); - } - toolbar = ToolBarDef.createJToolBar(); - toolbarDef.updateToolBar(toolbar); - - super.initComponentPane(); - } - - /** - * 指定索引添加对象 - * @param nameObject 对象名 - * @param index 索引 - */ - public void addNameObject(NameObject nameObject, int index) { - DefaultListModel model = (DefaultListModel) nameableList.getModel(); - - model.add(index, new ListModelElement(nameObject)); - nameableList.setSelectedIndex(index); - nameableList.ensureIndexIsVisible(index); - - nameableList.repaint(); - } - public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { @Override protected JavaScriptActionPane createJavaScriptActionPane() { return new JavaScriptActionPane() { - @Override protected DBManipulationPane createDBManipulationPane() { return new DBManipulationPane(ValueEditorPaneFactory.formEditors()); @@ -110,39 +70,6 @@ public class EventPropertyTable extends UIListControlPane { return false; } } - - /* - * 增加项的MenuDef - */ - protected class AddItemMenuDef extends MenuDef { - public AddItemMenuDef() { - this.setName(Inter.getLocText("Add")); - this.setMnemonic('A'); - this.setIconPath("/com/fr/design/images/control/addPopup.png"); - } - - public void populate(String[] eventNames) { - this.clearShortCuts(); - for (int i = 0; i < eventNames.length; i++) { - final String eventname = eventNames[i]; - - this.addShortCut(new UpdateAction() { - { - this.setName(switchLang(eventname)); - } - - public void actionPerformed(ActionEvent e) { - NameObject nameable = new NameObject(createUnrepeatedName(switchLang(eventname)), new Listener( - eventname,new JavaScriptImpl())); - - EventPropertyTable.this.addNameObject(nameable, EventPropertyTable.this.nameableList.getModel() - .getSize()); - updateWidgetListener(creator); - } - }); - } - } - } private String switchLang(String eventName) { return Inter.getLocText("Event-" + eventName);