|
|
@ -4,9 +4,9 @@ import com.fr.design.event.UIObserverListener; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.sort.expressionpane.CellSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.CellSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.CustomSequenceSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.CustomSequenceSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.EmptyExpressionPane; |
|
|
|
|
|
|
|
import com.fr.design.sort.expressionpane.FormulaSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.FormulaSortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.SortExpressionPane; |
|
|
|
import com.fr.design.sort.expressionpane.SortExpressionPane; |
|
|
|
import com.fr.report.core.sort.sortexpression.SortExpression; |
|
|
|
import com.fr.report.core.sort.sortexpression.SortExpression; |
|
|
@ -47,7 +47,6 @@ public abstract class AbstractSortItemPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void registerSortExpressionPanes() { |
|
|
|
private void registerSortExpressionPanes() { |
|
|
|
sortExpressionPanes.add(new EmptyExpressionPane()); |
|
|
|
|
|
|
|
sortExpressionPanes.add(new CellSortExpressionPane(sortItemPaneRightWidth)); |
|
|
|
sortExpressionPanes.add(new CellSortExpressionPane(sortItemPaneRightWidth)); |
|
|
|
sortExpressionPanes.add(new FormulaSortExpressionPane(sortItemPaneRightWidth)); |
|
|
|
sortExpressionPanes.add(new FormulaSortExpressionPane(sortItemPaneRightWidth)); |
|
|
|
sortExpressionPanes.add(new CustomSequenceSortExpressionPane(sortItemPaneWidth, sortItemPaneRightWidth)); |
|
|
|
sortExpressionPanes.add(new CustomSequenceSortExpressionPane(sortItemPaneWidth, sortItemPaneRightWidth)); |
|
|
@ -55,7 +54,7 @@ public abstract class AbstractSortItemPane extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
void initSortAreaPane() { |
|
|
|
void initSortAreaPane() { |
|
|
|
sortAreaPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP)); |
|
|
|
sortAreaPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP)); |
|
|
|
sortAreaPane.add(new UILabel("排序区域", SwingConstants.LEFT)); |
|
|
|
sortAreaPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Area"), SwingConstants.LEFT)); |
|
|
|
sortAreaPane.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
sortAreaPane.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
initMainSortAreaPane(sortAreaPane); |
|
|
|
initMainSortAreaPane(sortAreaPane); |
|
|
|
this.add(sortAreaPane); |
|
|
|
this.add(sortAreaPane); |
|
|
@ -65,9 +64,10 @@ public abstract class AbstractSortItemPane extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
void initSortRulePane() { |
|
|
|
void initSortRulePane() { |
|
|
|
sortRulePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP)); |
|
|
|
sortRulePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP)); |
|
|
|
sortRuleUiComboBox = new UIComboBox(new String[]{"升序", "降序", "不排序"}); |
|
|
|
sortRuleUiComboBox = new UIComboBox(new String[]{SortRule.ASC.getDescription(), |
|
|
|
|
|
|
|
SortRule.DES.getDescription(), SortRule.NO_SORT.getDescription()}); |
|
|
|
sortRuleUiComboBox.setPreferredSize(new Dimension(sortItemPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT)); |
|
|
|
sortRuleUiComboBox.setPreferredSize(new Dimension(sortItemPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT)); |
|
|
|
sortRulePane.add(new UILabel("排序规则", SwingConstants.LEFT)); |
|
|
|
sortRulePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Rule"), SwingConstants.LEFT)); |
|
|
|
sortRulePane.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
sortRulePane.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
sortRulePane.add(sortRuleUiComboBox); |
|
|
|
sortRulePane.add(sortRuleUiComboBox); |
|
|
|
this.add(sortRulePane); |
|
|
|
this.add(sortRulePane); |
|
|
@ -92,7 +92,7 @@ public abstract class AbstractSortItemPane extends JPanel { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sortBasisPanel.add(new UILabel("排序依据", SwingConstants.LEFT)); |
|
|
|
sortBasisPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Basis"), SwingConstants.LEFT)); |
|
|
|
sortBasisPanel.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
sortBasisPanel.add(AbstractSortPane.createIntervalUILabel()); |
|
|
|
sortBasisPanel.add(sortBasisUiComboBox); |
|
|
|
sortBasisPanel.add(sortBasisUiComboBox); |
|
|
|
this.add(sortBasisPanel); |
|
|
|
this.add(sortBasisPanel); |
|
|
@ -143,12 +143,9 @@ public abstract class AbstractSortItemPane extends JPanel { |
|
|
|
public SortExpression updateBean() { |
|
|
|
public SortExpression updateBean() { |
|
|
|
SortExpression sortExpression = currentSortExpressionPane.updateBean(); |
|
|
|
SortExpression sortExpression = currentSortExpressionPane.updateBean(); |
|
|
|
if (sortExpression != null) { |
|
|
|
if (sortExpression != null) { |
|
|
|
if (StringUtils.equals(sortRuleUiComboBox.getSelectedItem().toString(), "升序")) { |
|
|
|
String sortRule = sortRuleUiComboBox.getSelectedItem().toString(); |
|
|
|
sortExpression.setSortRule(SortRule.ASC); |
|
|
|
if (StringUtils.isNotBlank(sortRule)) { |
|
|
|
} else if (StringUtils.equals(sortRuleUiComboBox.getSelectedItem().toString(), "降序")) { |
|
|
|
sortExpression.setSortRule(SortRule.parse(sortRule)); |
|
|
|
sortExpression.setSortRule(SortRule.DES); |
|
|
|
|
|
|
|
} else if (StringUtils.equals(sortRuleUiComboBox.getSelectedItem().toString(), "不排序")) { |
|
|
|
|
|
|
|
sortExpression.setSortRule(SortRule.NO_SORT); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return sortExpression; |
|
|
|
return sortExpression; |
|
|
|