xiaoxia 8 years ago
parent
commit
bc58aa385d
  1. 34
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

34
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -32,6 +32,7 @@ public class FormWidgetDetailPane extends FormDockView{
private UITabbedPane tabbedPane; private UITabbedPane tabbedPane;
private JScrollPane downPanel; private JScrollPane downPanel;
private JPanel reuWidgetPanel; private JPanel reuWidgetPanel;
private UIComboBox comboBox;
private List<ElCaseBindInfo> elCaseBindInfoList; private List<ElCaseBindInfo> elCaseBindInfoList;
public static FormWidgetDetailPane getInstance() { public static FormWidgetDetailPane getInstance() {
@ -84,22 +85,10 @@ public class FormWidgetDetailPane extends FormDockView{
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList));
downPanel.setPreferredSize(new Dimension(236, 480)); downPanel.setPreferredSize(new Dimension(236, 480));
reuWidgetPanel = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); reuWidgetPanel = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
final UIComboBox comboBox = new UIComboBox(getCategories()); comboBox = new UIComboBox(getCategories());
comboBox.setPreferredSize(new Dimension(236, 30)); comboBox.setPreferredSize(new Dimension(236, 30));
comboBox.addItemListener(new ItemListener() { initComboBoxSelectedListener();
@Override
public void itemStateChanged(ItemEvent e) {
int filterIndex = comboBox.getSelectedIndex();
if (filterIndex == 0) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} else {
String filterName = (String) e.getItem();
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName);
}
refreshDownPanel();
}
});
reuWidgetPanel.add(comboBox, BorderLayout.NORTH); reuWidgetPanel.add(comboBox, BorderLayout.NORTH);
reuWidgetPanel.add(downPanel, BorderLayout.CENTER); reuWidgetPanel.add(downPanel, BorderLayout.CENTER);
reuWidgetPanel.setBorder(new LineBorder(Color.gray)); reuWidgetPanel.setBorder(new LineBorder(Color.gray));
@ -123,6 +112,23 @@ public class FormWidgetDetailPane extends FormDockView{
} }
private void initComboBoxSelectedListener() {
comboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
int filterIndex = comboBox.getSelectedIndex();
if (filterIndex == 0) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
} else {
String filterName = (String) e.getItem();
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName);
}
refreshDownPanel();
}
});
}
public String[] getCategories() { public String[] getCategories() {
return ShareConstants.WIDGET_CATEGORIES; return ShareConstants.WIDGET_CATEGORIES;
} }

Loading…
Cancel
Save