Browse Source

Pull request #10722: REPORT-84428 设置像&模板内容频繁切换会出现空白或全选的异常情况

Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0

* commit 'c633c8f8aa295f72ad7249fdfdcad0def3bcfe7a':
  REPORT-84428 设置像&模板内容频繁切换会出现空白或全选的异常情况
release/11.0
Destiny.Lin-林锦龙 2 years ago
parent
commit
14e3caa371
  1. 33
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java

33
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java

@ -14,11 +14,11 @@ import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.util.List;
@ -49,31 +49,28 @@ public class ITReplaceWestPanel {
contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
settingButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Replace_Setting"));
contentButton.setText(CONTENT_TEXT);
contentButton.addActionListener(new ActionListener() {
contentButton.addChangeListener(new ChangeListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!contentButton.isSelected()) {
public void stateChanged(ChangeEvent e) {
if (contentButton.isSelected()) {
showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList());
settingButton.setSelected(!contentButton.isSelected());
changeColor4SelectContent();
} else {
showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList());
contentButton.setSelected(true);
}
changeColor4SelectContent();
settingButton.setSelected(contentButton.isSelected());
}
});
settingButton.addActionListener(new ActionListener() {
settingButton.addChangeListener(new ChangeListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!settingButton.isSelected()) {
public void stateChanged(ChangeEvent e) {
if (settingButton.isSelected()) {
showSelectPanel(ITReplaceNorthPanel.CARD_SETTING, ITReplaceMainDialog.getSearchSettingResultList());
contentButton.setSelected(!settingButton.isSelected());
changeColor4SelectContent();
} else {
showSelectPanel(ITReplaceNorthPanel.CARD_CONTENT, ITReplaceMainDialog.getSearchContentResultList());
settingButton.setSelected(true);
}
changeColor4SelectContent();
contentButton.setSelected(settingButton.isSelected());
}
});
leftPanel.setBackground(Color.WHITE);
@ -118,7 +115,7 @@ public class ITReplaceWestPanel {
* 切换面板时改变颜色
*/
public void changeColor4SelectContent() {
if (!contentButton.isSelected()) {
if (contentButton.isSelected()) {
contentButton.setText(CONTENT_TEXT);
settingButton.setText(Toolkit.i18nText("Fine-Design_Replace_Setting"));
} else {

Loading…
Cancel
Save