Browse Source

REPORT-64655 【视觉验收】模板主题管理

【问题原因】
1. 修改主题单元格样式编辑中的外边距
2. 去除主题编辑面板中单元格样式列表项的默认图标

【改动思路】
同上
bugfix/11.0
Starryi 3 years ago
parent
commit
db4ca30028
  1. 47
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

47
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -102,20 +102,8 @@ public class CellStyleListEditPane extends JListControlPane {
@Override
protected JNameEdList createJNameList() {
JNameEdList nameEdList = super.createJNameList();
nameEdList.setCellEditor(new DefaultListCellEditor(new UITextField()) {
@Override
public Component getListCellEditorComponent(JList list, Object value, boolean isSelected, int index) {
ListModelElement element = (ListModelElement) getModel().getElementAt(index);
if (element != null) {
NameObject selectNameObject = (NameObject) element.wrapper;
ThemedCellStyle cellStyle = (ThemedCellStyle) (selectNameObject.getObject());
if (!cellStyle.isRemovable()) {
return null;
}
}
return super.getListCellEditorComponent(list, value, isSelected, index);
}
});
nameEdList.setCellEditor(new UnEditableListCellEditor(new UITextField()));
nameEdList.setCellRenderer(new NoIconNameableListCellRenderer());
return nameEdList;
}
@ -294,4 +282,35 @@ public class CellStyleListEditPane extends JListControlPane {
return ((ThemedCellStyle) ob).isUse4Default();
}
}
private class NoIconNameableListCellRenderer extends NameableListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (component instanceof NameableListCellRenderer) {
((NameableListCellRenderer) component).setIcon(null);
((NameableListCellRenderer) component).setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
}
return component;
}
}
private class UnEditableListCellEditor extends DefaultListCellEditor {
public UnEditableListCellEditor(UITextField textField) {
super(textField);
}
@Override
public Component getListCellEditorComponent(JList list, Object value, boolean isSelected, int index) {
ListModelElement element = (ListModelElement) getModel().getElementAt(index);
if (element != null) {
NameObject selectNameObject = (NameObject) element.wrapper;
ThemedCellStyle cellStyle = (ThemedCellStyle) (selectNameObject.getObject());
if (!cellStyle.isRemovable()) {
return null;
}
}
return super.getListCellEditorComponent(list, value, isSelected, index);
}
}
}

4
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -136,10 +136,11 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 10));
this.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(215, 48));
previewArea.setPreferredSize(new Dimension(207, 48));
previewPane.setBorder(BorderFactory.createCompoundBorder(
BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")),
BorderFactory.createEmptyBorder(4, 4, 4, 4)));
@ -150,7 +151,6 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
JPanel settingsPane = new JPanel();
this.add(settingsPane, BorderLayout.CENTER);
settingsPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
settingsPane.setLayout(new BorderLayout(0, 4));
settingsPane.add(tabPane, BorderLayout.NORTH);

Loading…
Cancel
Save