Browse Source

Merge pull request #7363 in DESIGN/design from release/11.0 to feature/x

* commit 'f59940b899edebc5cd35563aedbeee98fd74418e':
  REPORT-64811 保持设计器商城下载reu文件名中的版本信息
  REPORT-64741 【组件可更新提醒】组件复用-设计器端安装设计器版本高于当前设计器版本的组件的情况
  REPORT-64655 【视觉验收】模板主题管理
feature/x
superman 3 years ago
parent
commit
84d244f970
  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