You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.1 KiB
58 lines
2.1 KiB
7 years ago
|
package com.fr.plugin.cell.highlight.ui;
|
||
9 years ago
|
|
||
|
import com.fr.design.condition.ConditionAttrSingleConditionPane;
|
||
|
import com.fr.design.condition.ConditionAttributesPane;
|
||
|
import com.fr.design.gui.icombobox.UIComboBox;
|
||
|
import com.fr.design.gui.icombobox.UIDictionaryComboBox;
|
||
|
import com.fr.general.Inter;
|
||
7 years ago
|
import com.fr.plugin.cell.highlight.fun.AlignHighlightAction;
|
||
9 years ago
|
import com.fr.report.cell.cellattr.highlight.HighlightAction;
|
||
|
import com.fr.stable.Constants;
|
||
|
|
||
|
import javax.swing.*;
|
||
|
|
||
|
/**
|
||
|
* @author richie
|
||
|
* @date 2015-03-26
|
||
|
* @since 8.0
|
||
|
*/
|
||
7 years ago
|
public class AlignHighlightPane extends ConditionAttrSingleConditionPane<HighlightAction> {
|
||
9 years ago
|
private UIDictionaryComboBox<Integer> alignComboBox;
|
||
|
private JComboBox scopeComboBox;
|
||
|
|
||
7 years ago
|
public AlignHighlightPane(ConditionAttributesPane conditionAttributesPane) {
|
||
9 years ago
|
super(conditionAttributesPane);
|
||
|
this.alignComboBox = new UIDictionaryComboBox<Integer>(
|
||
|
new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT},
|
||
|
new String[]{
|
||
|
Inter.getLocText("Plugin-Highlight_Align_Left"),
|
||
|
Inter.getLocText("Plugin-Highlight_Align_Center"),
|
||
|
Inter.getLocText("Plugin-Highlight_Align_Right")}
|
||
|
);
|
||
|
add(alignComboBox);
|
||
|
this.scopeComboBox = new UIComboBox(new String[]{
|
||
7 years ago
|
Inter.getLocText("Plugin-Highlight_Align_Current_Cell"),
|
||
|
Inter.getLocText("Plugin-Highlight_Align_Current_Row"),
|
||
|
Inter.getLocText("Plugin-Highlight_Align_Current_Column")});
|
||
9 years ago
|
|
||
|
this.add(this.scopeComboBox);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String nameForPopupMenuItem() {
|
||
|
return Inter.getLocText("Plugin-Highlight_Align");
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void populate(HighlightAction condition) {
|
||
7 years ago
|
AlignHighlightAction action = (AlignHighlightAction) condition;
|
||
9 years ago
|
scopeComboBox.setSelectedIndex(action.getScope());
|
||
|
alignComboBox.setSelectedItem(action.getAlign());
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public HighlightAction update() {
|
||
7 years ago
|
return new AlignHighlightAction(alignComboBox.getSelectedItem(), scopeComboBox.getSelectedIndex());
|
||
9 years ago
|
}
|
||
|
|
||
|
}
|