|
|
@ -7,6 +7,7 @@ import com.fr.base.theme.settings.ThemeThumbnail; |
|
|
|
import com.fr.base.theme.settings.ThemedCellStyleList; |
|
|
|
import com.fr.base.theme.settings.ThemedCellStyleList; |
|
|
|
import com.fr.base.theme.settings.ThemedChartStyle; |
|
|
|
import com.fr.base.theme.settings.ThemedChartStyle; |
|
|
|
import com.fr.base.theme.settings.ThemedColorScheme; |
|
|
|
import com.fr.base.theme.settings.ThemedColorScheme; |
|
|
|
|
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; |
|
|
|
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
@ -26,6 +27,7 @@ import com.fr.design.mainframe.theme.edit.ui.ColorListPane; |
|
|
|
import com.fr.design.mainframe.theme.edit.ui.LabelUtils; |
|
|
|
import com.fr.design.mainframe.theme.edit.ui.LabelUtils; |
|
|
|
import com.fr.design.mainframe.theme.ui.BorderUtils; |
|
|
|
import com.fr.design.mainframe.theme.ui.BorderUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.transaction.CallBackAdaptor; |
|
|
|
import com.fr.transaction.CallBackAdaptor; |
|
|
@ -44,6 +46,7 @@ import javax.swing.event.DocumentEvent; |
|
|
|
import javax.swing.event.DocumentListener; |
|
|
|
import javax.swing.event.DocumentListener; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Image; |
|
|
|
import java.awt.Image; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
@ -63,12 +66,12 @@ import static com.fr.design.i18n.Toolkit.i18nText; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends AbstractAttrNoScrollPane { |
|
|
|
public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends AbstractAttrNoScrollPane { |
|
|
|
public static final int TITLE_BORDER_FONT = 12; |
|
|
|
public static final int TITLE_BORDER_FONT = 12; |
|
|
|
public static final int LEFT_TITLE_PANE_WIDTH = 397; |
|
|
|
public static final int LEFT_TITLE_PANE_WIDTH = 627; |
|
|
|
public static final int LEFT_TITLE_PANE_HEIGHT = 532 + TITLE_BORDER_FONT / 2 + 10; |
|
|
|
public static final int LEFT_TITLE_PANE_HEIGHT = 539; |
|
|
|
public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10; |
|
|
|
public static final int PREVIEW_PANE_WIDTH = LEFT_TITLE_PANE_WIDTH - 10; |
|
|
|
public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16; |
|
|
|
public static final int PREVIEW_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT - TITLE_BORDER_FONT - 16; |
|
|
|
|
|
|
|
|
|
|
|
public static final int RIGHT_PANE_WIDTH = 362; |
|
|
|
public static final int RIGHT_PANE_WIDTH = 352; |
|
|
|
public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT; |
|
|
|
public static final int RIGHT_PANE_HEIGHT = LEFT_TITLE_PANE_HEIGHT; |
|
|
|
public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298; |
|
|
|
public static final int COLOR_SCHEME_TITLE_PANE_WIDTH = 298; |
|
|
|
public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2; |
|
|
|
public static final int COLOR_SCHEME_TITLE_PANE_HEIGHT = 174 + TITLE_BORDER_FONT / 2; |
|
|
@ -90,6 +93,8 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
private UIButton saveButton = new UIButton(); |
|
|
|
private UIButton saveButton = new UIButton(); |
|
|
|
private UIButton saveAsButton = new UIButton(); |
|
|
|
private UIButton saveAsButton = new UIButton(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean refreshingThemedColor = false; |
|
|
|
|
|
|
|
|
|
|
|
private boolean currentIsNewTheme; |
|
|
|
private boolean currentIsNewTheme; |
|
|
|
private T theme; |
|
|
|
private T theme; |
|
|
|
|
|
|
|
|
|
|
@ -142,19 +147,17 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
|
|
|
|
|
|
|
|
themePreviewPane = createThemePreviewPane(); |
|
|
|
themePreviewPane = createThemePreviewPane(); |
|
|
|
themePreviewPane.setPreferredSize(new Dimension(PREVIEW_PANE_WIDTH, PREVIEW_PANE_HEIGHT)); |
|
|
|
themePreviewPane.setPreferredSize(new Dimension(PREVIEW_PANE_WIDTH, PREVIEW_PANE_HEIGHT)); |
|
|
|
themePreviewPane.setPreferredSize(new Dimension(PREVIEW_PANE_WIDTH, PREVIEW_PANE_HEIGHT)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
previewContainer.add(themePreviewPane, BorderLayout.CENTER); |
|
|
|
previewContainer.add(themePreviewPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
return titleContainer; |
|
|
|
return titleContainer; |
|
|
|
} |
|
|
|
} |
|
|
|
private JPanel createRightPane() { |
|
|
|
private JPanel createRightPane() { |
|
|
|
JPanel container = new JPanel(new BorderLayout(0, 12)); |
|
|
|
JPanel container = new JPanel(new BorderLayout(0, 0)); |
|
|
|
container.setPreferredSize(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT)); |
|
|
|
container.setPreferredSize(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT)); |
|
|
|
JPanel nameEditPane = createNameEditPane(); |
|
|
|
JPanel nameEditPane = createNameEditPane(); |
|
|
|
container.add(nameEditPane, BorderLayout.NORTH); |
|
|
|
container.add(nameEditPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
JPanel settingPane = new JPanel(new BorderLayout(0, 10)); |
|
|
|
JPanel settingPane = new JPanel(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); |
|
|
|
container.add(settingPane, BorderLayout.CENTER); |
|
|
|
container.add(settingPane, BorderLayout.CENTER); |
|
|
|
settingPane.add(createColorSchemeEditPane(), BorderLayout.NORTH); |
|
|
|
settingPane.add(createColorSchemeEditPane(), BorderLayout.NORTH); |
|
|
|
settingPane.add(createCustomEditorsPane(), BorderLayout.CENTER); |
|
|
|
settingPane.add(createCustomEditorsPane(), BorderLayout.CENTER); |
|
|
@ -170,13 +173,6 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createNameEditPane() { |
|
|
|
private JPanel createNameEditPane() { |
|
|
|
JPanel container = new JPanel(new BorderLayout(30, 0)); |
|
|
|
|
|
|
|
container.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); |
|
|
|
|
|
|
|
container.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Name")), BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel settingContainer = new JPanel(new BorderLayout(10, 0)); |
|
|
|
|
|
|
|
container.add(settingContainer, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameErrorLabel = LabelUtils.createLabel(StringUtils.EMPTY, Color.RED); |
|
|
|
nameErrorLabel = LabelUtils.createLabel(StringUtils.EMPTY, Color.RED); |
|
|
|
nameErrorLabel.setVisible(false); |
|
|
|
nameErrorLabel.setVisible(false); |
|
|
|
|
|
|
|
|
|
|
@ -187,14 +183,14 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -207,22 +203,26 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, false, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, true, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
settingContainer.add(nameTextField, BorderLayout.WEST); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
|
|
settingContainer.add(nameErrorLabel, BorderLayout.CENTER); |
|
|
|
JPanel container = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ |
|
|
|
|
|
|
|
new Component[] { LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Name")), nameTextField }, |
|
|
|
|
|
|
|
new Component[] { null, nameErrorLabel }, |
|
|
|
|
|
|
|
}, new double[] { 20, 20}, new double[] { p, 165}, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_W0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
container.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); |
|
|
|
return container; |
|
|
|
return container; |
|
|
|
} |
|
|
|
} |
|
|
|
private JPanel createColorSchemeEditPane() { |
|
|
|
private JPanel createColorSchemeEditPane() { |
|
|
@ -265,8 +265,13 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
colorListPane.addColorChangeListener(new ChangeListener() { |
|
|
|
colorListPane.addColorChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
|
|
|
if (refreshingThemedColor) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
List<Color> colors = colorListPane.update(); |
|
|
|
List<Color> colors = colorListPane.update(); |
|
|
|
|
|
|
|
refreshingThemedColor = true; |
|
|
|
onColorSchemeChanged(colors); |
|
|
|
onColorSchemeChanged(colors); |
|
|
|
|
|
|
|
refreshingThemedColor = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -283,7 +288,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
return container; |
|
|
|
return container; |
|
|
|
} |
|
|
|
} |
|
|
|
public void addCustomEditorPane(String title, JComponent component) { |
|
|
|
public void addCustomEditorPane(String title, JComponent component) { |
|
|
|
component.setPreferredSize(new Dimension(360, 260)); |
|
|
|
component.setPreferredSize(new Dimension(317, 239)); |
|
|
|
uiTabbedPane.addTab(title, component); |
|
|
|
uiTabbedPane.addTab(title, component); |
|
|
|
} |
|
|
|
} |
|
|
|
protected JPanel createCellStyleSettingPane() { |
|
|
|
protected JPanel createCellStyleSettingPane() { |
|
|
@ -310,12 +315,12 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
public void onColorSchemeChanged(List<Color> colors) { |
|
|
|
public void onColorSchemeChanged(List<Color> colors) { |
|
|
|
colorListExtendedPane.populate(colors); |
|
|
|
colorListExtendedPane.populate(colors); |
|
|
|
FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); |
|
|
|
FineColorManager.FineColorReplaceByColorScheme replaceByColorScheme = new FineColorManager.FineColorReplaceByColorScheme(colors); |
|
|
|
ThemedCellStyleList cellStyle = cellStyleSettingPane.updateBean(); |
|
|
|
T theme = updateBean(); |
|
|
|
FineColorManager.traverse(cellStyle, replaceByColorScheme); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ThemedChartStyle themedChartStyle = chartStyleSettingPane.updateBean(); |
|
|
|
FineColorManager.traverse(theme, replaceByColorScheme); |
|
|
|
FineColorManager.traverse(themedChartStyle, replaceByColorScheme); |
|
|
|
populateBean(theme); |
|
|
|
chartStyleSettingPane.populateBean(themedChartStyle); |
|
|
|
|
|
|
|
|
|
|
|
//图表渐变色
|
|
|
|
chartStyleSettingPane.populateGradientBar(colors); |
|
|
|
chartStyleSettingPane.populateGradientBar(colors); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -389,7 +394,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
T theme = updateBean(); |
|
|
|
T theme = updateBean(); |
|
|
|
boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton); |
|
|
|
boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, true, currentIsNewTheme, true, nameTextField, nameErrorLabel, saveButton); |
|
|
|
if (canBeSaved && theme != null) { |
|
|
|
if (canBeSaved && theme != null) { |
|
|
|
theme.setName(nameTextField.getText()); |
|
|
|
theme.setName(nameTextField.getText()); |
|
|
|
config.addTheme(theme, true, new CallBackAdaptor() { |
|
|
|
config.addTheme(theme, true, new CallBackAdaptor() { |
|
|
@ -474,14 +479,14 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -494,14 +499,14 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
public void focusGained(FocusEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, false, true, true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
public void focusLost(FocusEvent e) { |
|
|
|
if (isEnabled()) { |
|
|
|
if (isEnabled()) { |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
checkThemeCanBeSavedAndUpdateUI(true, true, true, true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -547,7 +552,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
FineLoggerFactory.getLogger().error(ex.getMessage(), ex); |
|
|
|
FineLoggerFactory.getLogger().error(ex.getMessage(), ex); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(true, true, true, true, nameTextField, nameErrorLabel, confirmButton); |
|
|
|
if (canBeSaved && newThemeObject != null) { |
|
|
|
if (canBeSaved && newThemeObject != null) { |
|
|
|
newThemeObject.setName(name); |
|
|
|
newThemeObject.setName(name); |
|
|
|
newThemeObject.setRemovable(true); |
|
|
|
newThemeObject.setRemovable(true); |
|
|
@ -583,17 +588,28 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends |
|
|
|
private boolean isThemeNameDuplicated(String name) { |
|
|
|
private boolean isThemeNameDuplicated(String name) { |
|
|
|
return config.cachedFetch(name) != null; |
|
|
|
return config.cachedFetch(name) != null; |
|
|
|
} |
|
|
|
} |
|
|
|
private boolean checkThemeCanBeSavedAndUpdateUI(boolean checkDuplicated, UITextField textField, UILabel errorLabel, UIButton... actionButtons) { |
|
|
|
private boolean checkThemeCanBeSavedAndUpdateUI( |
|
|
|
String error = StringUtils.EMPTY; |
|
|
|
boolean checkEmpty, |
|
|
|
|
|
|
|
boolean displayEmptyTip, |
|
|
|
|
|
|
|
boolean checkDuplicated, |
|
|
|
|
|
|
|
boolean displayDuplicatedTip, |
|
|
|
|
|
|
|
UITextField textField, |
|
|
|
|
|
|
|
UILabel errorLabel, UIButton... actionButtons) { |
|
|
|
String name = textField.getText(); |
|
|
|
String name = textField.getText(); |
|
|
|
if (isThemeNameEmpty(name)) { |
|
|
|
|
|
|
|
error = Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Empty_Name_Error_Tip"); |
|
|
|
boolean valid = true; |
|
|
|
|
|
|
|
errorLabel.setText(StringUtils.EMPTY); |
|
|
|
|
|
|
|
if (checkEmpty && isThemeNameEmpty(name)) { |
|
|
|
|
|
|
|
valid = false; |
|
|
|
|
|
|
|
if (displayEmptyTip) { |
|
|
|
|
|
|
|
errorLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Empty_Name_Error_Tip")); |
|
|
|
|
|
|
|
} |
|
|
|
} else if (checkDuplicated && isThemeNameDuplicated(name)) { |
|
|
|
} else if (checkDuplicated && isThemeNameDuplicated(name)) { |
|
|
|
error = Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Duplicated_Name_Error_Tip"); |
|
|
|
valid = false; |
|
|
|
|
|
|
|
if (displayDuplicatedTip) { |
|
|
|
|
|
|
|
errorLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Duplicated_Name_Error_Tip")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
errorLabel.setText(error); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean valid = StringUtils.isEmpty(error); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
errorLabel.setVisible(!valid); |
|
|
|
errorLabel.setVisible(!valid); |
|
|
|
if (actionButtons != null && actionButtons.length > 0) { |
|
|
|
if (actionButtons != null && actionButtons.length > 0) { |
|
|
|