Browse Source

Merge pull request #197 in BA/design from ~SHINE/design:dev to dev

* commit '8e4dc84db1e2f259bc53e7eb6387dcf6c32aa6e4':
  bug
master
superman 8 years ago
parent
commit
a9b4856552
  1. 29
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

29
designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

@ -1,32 +1,33 @@
package com.fr.design.mainframe.chart.gui.data; package com.fr.design.mainframe.chart.gui.data;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.design.constants.UIConstants; import com.fr.data.impl.NameTableData;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.dialog.BasicPane;
import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class DatabaseTableDataPane extends BasicPane{ public class DatabaseTableDataPane extends BasicPane{
private static final long serialVersionUID = 5316016202202932242L; private static final long serialVersionUID = 5316016202202932242L;
private TableDataComboBox tableNameCombox; private TableDataComboBox tableNameCombox;
private UIButton reviewButton; private UIButton reviewButton;
private Object lastSelectObject;
public DatabaseTableDataPane(UILabel label) { public DatabaseTableDataPane(UILabel label) {
initTableCombox(); initTableCombox();
initReviewButton(); initReviewButton();
@ -74,9 +75,11 @@ public class DatabaseTableDataPane extends BasicPane{
tableNameCombox.addItemListener(new ItemListener() { tableNameCombox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.DESELECTED){ if(e.getStateChange() == ItemEvent.DESELECTED
|| (lastSelectObject == null && e.getStateChange() == ItemEvent.SELECTED)){
userEvent(); userEvent();
} }
lastSelectObject = tableNameCombox.getSelectedItem();
} }
}); });
} }

Loading…
Cancel
Save