Browse Source

REPORT-62480 调整下代码方便埋点设计

feature/x
Henry.Wang 3 years ago
parent
commit
8e74e0611a
  1. 8
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java
  2. 2
      designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java
  3. 6
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java
  4. 38
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

8
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java

@ -82,8 +82,7 @@ public abstract class AbstractSortItemPane extends JPanel {
if (currentSortExpressionPane != null) {
currentSortExpressionPane.setVisible(false);
}
currentSortExpressionPane = sortExpressionPanes.get(sortBasisUiComboBox.getSelectedIndex());
refreshCurrentSortExpressionPane();
triggerItemChanged(sortBasisUiComboBox.getSelectedIndex());
}
}
});
@ -97,6 +96,11 @@ public abstract class AbstractSortItemPane extends JPanel {
}
}
void triggerItemChanged(Integer index) {
currentSortExpressionPane = sortExpressionPanes.get(index);
refreshCurrentSortExpressionPane();
}
private void refreshCurrentSortExpressionPane() {
currentSortExpressionPane.setVisible(true);
sortAreaPane.setVisible(currentSortExpressionPane.needSortArea());

2
designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

@ -240,8 +240,10 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
for (ColumnRow headerColumnRow : disableHeaderCellsStyleMap.keySet()) {
TemplateCellElement headerTemplateCellElement
= elementCase.getTemplateCellElement(headerColumnRow.column, headerColumnRow.row);
if (headerTemplateCellElement != null) {
headerTemplateCellElement.setStyle(disableHeaderCellsStyleMap.get(headerColumnRow));
}
}
for (TemplateCellElement templateCellElement : tempHeaderCells) {
elementCase.removeCellElement(templateCellElement);
}

6
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

@ -43,7 +43,8 @@ public class CustomSequencePane extends JPanel {
@Override
public void doOk() {
customSequence = customSequenceEditPane.updateBean();
textField.setText(CustomSequenceSortExpression.customSequenceToString(customSequence, ","));
triggerOk(CustomSequenceSortExpression.customSequenceToString(customSequence, ","),
CustomSequenceSortExpression.isReferenceCustomSequence(customSequence));
}
}, new Dimension(700, 400)).setVisible(true);
}
@ -54,6 +55,9 @@ public class CustomSequencePane extends JPanel {
this.add(button);
}
private void triggerOk(String customSequence, Boolean referenceCustomSequence) {
textField.setText(customSequence);
}
public List<String> updateBean() {
return customSequence;

38
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -113,7 +113,7 @@ public class HeaderAreaPane extends JPanel {
SortColumnRowPane columnRowPane;
JLayeredPane jLayeredPane;
UIComboBox uiComboBox;
boolean populateBeaning;
boolean showHeaderArea;
AreaJLayeredPane() {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
@ -132,36 +132,37 @@ public class HeaderAreaPane extends JPanel {
uiComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() != uiComboBox.getSelectedIndex()) {
setSortColumnRowPaneShow(uiComboBox.getSelectedIndex() == 1);
if ((showHeaderArea ? 1 : 0) != uiComboBox.getSelectedIndex()) {
triggerItemChanged(uiComboBox.getSelectedIndex());
}
}
});
uiComboBox.setEnabled(false);
}
void setSortColumnRowPaneShow(boolean show) {
if (show) {
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER);
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER);
if (!populateBeaning) {
void triggerItemChanged(Integer index) {
setSortColumnRowPaneShow(index == 1);
if (index == 1) {
ColumnRow columnRow = columnRowPane.updateBean();
if (cellSelectionManager.isNotSelectables(columnRow)) {
columnRowPane.setColumnRow(ColumnRow.ERROR);
} else {
cellSelectionManager.addNotSelectables(columnRow);
}
} else {
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
}
}
void setSortColumnRowPaneShow(boolean show) {
if (show) {
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER);
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER);
} else {
jLayeredPane.setLayer(uiComboBox, JLayeredPane.POPUP_LAYER);
jLayeredPane.setLayer(columnRowPane, JLayeredPane.MODAL_LAYER);
if (!populateBeaning) {
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
}
}
showHeaderArea = show;
refresh();
}
@ -175,16 +176,11 @@ public class HeaderAreaPane extends JPanel {
}
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
populateBeaning = true;
cellSelectionManager.build();
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
if (showHeaderArea) {
uiComboBox.setSelectedIndex(1);
} else {
uiComboBox.setSelectedIndex(0);
}
setSortColumnRowPaneShow(showHeaderArea);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);
uiComboBox.setEnabled(enabled);
populateBeaning = false;
}
public ColumnRow updateBean() {

Loading…
Cancel
Save