|
|
|
@ -24,6 +24,8 @@ import java.awt.event.ItemListener;
|
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; |
|
|
|
|
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author richie |
|
|
|
@ -64,34 +66,37 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// this.valueTextField.setText("");
|
|
|
|
|
JPanel type = new JPanel(new BorderLayout()); |
|
|
|
|
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); |
|
|
|
|
type.add(valueEditor); |
|
|
|
|
presentComboBox.addItemListener(new ItemListener() { |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
if (presentComboBox.getSelectedIndex() == 1){ |
|
|
|
|
if (valueEditor.getParent() == PresentHighlightPane.this) { |
|
|
|
|
PresentHighlightPane.this.remove(valueEditor); |
|
|
|
|
if (valueEditor.getParent() == type) { |
|
|
|
|
type.remove(valueEditor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PresentHighlightPane.this.add(editButton); |
|
|
|
|
type.add(editButton); |
|
|
|
|
PresentHighlightPane.this.validate(); |
|
|
|
|
PresentHighlightPane.this.repaint(); |
|
|
|
|
} else { |
|
|
|
|
if (editButton.getParent() == PresentHighlightPane.this) { |
|
|
|
|
PresentHighlightPane.this.remove(editButton); |
|
|
|
|
if (editButton.getParent() == type) { |
|
|
|
|
type.remove(editButton); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PresentHighlightPane.this.add(valueEditor); |
|
|
|
|
type.add(valueEditor); |
|
|
|
|
PresentHighlightPane.this.validate(); |
|
|
|
|
PresentHighlightPane.this.repaint(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
presentComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); |
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
this.add(row(10, cell(label).weight(0.2), row( |
|
|
|
|
10, |
|
|
|
|
cell(presentComboBox), |
|
|
|
|
cell(valueEditor)).weight(0.8) |
|
|
|
|
cell(type)).weight(0.8) |
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER); |
|
|
|
|
this.add(cancel, BorderLayout.EAST); |
|
|
|
|
} |
|
|
|
|