|
|
@ -1,19 +1,20 @@ |
|
|
|
package com.fr.design.widget; |
|
|
|
package com.fr.design.widget; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
|
|
|
import com.fr.design.fun.WidgetDesignHandler; |
|
|
|
import com.fr.design.gui.core.WidgetOption; |
|
|
|
import com.fr.design.gui.core.WidgetOption; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
import com.fr.design.mainframe.ElementCasePane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.widget.btn.ButtonConstants; |
|
|
|
import com.fr.form.ui.Button; |
|
|
|
import com.fr.form.ui.Button; |
|
|
|
import com.fr.form.ui.*; |
|
|
|
import com.fr.form.ui.*; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.design.widget.btn.ButtonConstants; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
@ -61,16 +62,22 @@ public class WidgetPane extends BasicPane implements ItemListener { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 状态改变 |
|
|
|
* 状态改变 |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 事件对象 |
|
|
|
* @param e 事件对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
|
|
|
|
Widget oldWidget = update(); |
|
|
|
|
|
|
|
Widget selectedItem = editorTypeComboBox.getCellWidget(); |
|
|
|
|
|
|
|
WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getWidgetDesignHandler(); |
|
|
|
|
|
|
|
if (handler != null) { |
|
|
|
|
|
|
|
handler.transferWidgetProperties(oldWidget, selectedItem); |
|
|
|
|
|
|
|
} |
|
|
|
if (e.getItem() instanceof Item && ((Item) e.getItem()).getValue() instanceof WidgetConfig) { |
|
|
|
if (e.getItem() instanceof Item && ((Item) e.getItem()).getValue() instanceof WidgetConfig) { |
|
|
|
populate(editorTypeComboBox.getCellWidget()); |
|
|
|
populate(selectedItem); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (shouldFireSelectedEvent) { |
|
|
|
if (shouldFireSelectedEvent) { |
|
|
|
Widget selectedItem = editorTypeComboBox.getCellWidget(); |
|
|
|
|
|
|
|
populateWidgetConfig(selectedItem); |
|
|
|
populateWidgetConfig(selectedItem); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -109,9 +116,9 @@ public class WidgetPane extends BasicPane implements ItemListener { |
|
|
|
public Widget update() { |
|
|
|
public Widget update() { |
|
|
|
return cellEditorCardPane.update(); |
|
|
|
return cellEditorCardPane.update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void populateWidgetConfig(Widget widget) { |
|
|
|
protected void populateWidgetConfig(Widget widget) { |
|
|
|
cellEditorCardPane.populate(widget); |
|
|
|
cellEditorCardPane.populate(widget); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -190,12 +197,13 @@ public class WidgetPane extends BasicPane implements ItemListener { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private WidgetOption[] getWidgetOptions() { |
|
|
|
private WidgetOption[] getWidgetOptions() { |
|
|
|
return (WidgetOption[])ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); |
|
|
|
return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 校验 |
|
|
|
* 校验 |
|
|
|
|
|
|
|
* |
|
|
|
* @throws Exception 抛出异常 |
|
|
|
* @throws Exception 抛出异常 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void checkValid() throws Exception { |
|
|
|
public void checkValid() throws Exception { |
|
|
@ -222,6 +230,7 @@ public class WidgetPane extends BasicPane implements ItemListener { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 转化成字符串形式 |
|
|
|
* 转化成字符串形式 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 返回字符串 |
|
|
|
* @return 返回字符串 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|