forked from fanruan/design
Browse Source
* commit 'fa49d986f61109e370a0ecaa7645609da472354b': (50 commits) REPORT-26147 @harrison:新的release的jar和旧版本的性能插件,性能插件需要自动禁用 改 apilevel 满足不了全部禁用的需求。 改回原来的名字,不然旧版本的性能插件没法正常用。 REPORT-26091 && REPORT-26181 REPORT-26160 && REPORT-26204 && && REPORT-25532 MOBILE-23781 单选按钮组的弹出配置框,有时候点击Tab不会切换 MOBILE-24787 设计器上第一次打开已有弹窗设置模板,发现弹窗设置界面为空 REPORT-24314 10.0.4启动画面 非中文版提供 REPORT-25645 mac设计器取色器异常 REPORT-25447 10.0.4设计器表单设计奇怪的bug MOBILE-24213 单选按钮 选项值前面会出现虚线 && 默认值 判断条件有误 REPORT-25730 最新的release设计器启动后一直报模板不存在 还需要判断是否存在 REPORT-25730 最新的release设计器启动后一直报模板不存在 这里执行的时候需要判空。 无jira任务, 冲突 调整 无JIRA任务,1.8编译单元测试代码失败 fix REPORT-25417 智能添加单元格点击不准确 1.8编译单元测试代码失败 REPORT-24604 表单拖动图表与画布块交叉设计器卡死 REPORT-24344 Spider数据集插件需要约束下BI 相关jar的 jar time 开放校验接口。 ...final/10.0
Kara
5 years ago
162 changed files with 2690 additions and 1130 deletions
@ -0,0 +1,290 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
import com.fr.invoke.Reflect; |
||||
|
||||
import javax.swing.Icon; |
||||
import javax.swing.JDialog; |
||||
import javax.swing.JOptionPane; |
||||
import java.awt.Component; |
||||
import java.awt.HeadlessException; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* @version 10.0 |
||||
* Created by Joe on 12/5/2019 |
||||
*/ |
||||
public class FineJOptionPane extends JOptionPane { |
||||
|
||||
public final static String[] OPTION_DEFAULT = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_OK") }; |
||||
public final static String[] OPTION_YES_NO = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No") }; |
||||
public final static String[] OPTION_YES_NO_CANCEL = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel") }; |
||||
public final static String[] OPTION_OK_CANCEL = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_OK"), |
||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Cancel") }; |
||||
|
||||
//选项类型optionType 和 选项字符串数组 一一对应
|
||||
private final static Map<Integer, String[]> OPTION_MAP = new HashMap<>(); |
||||
|
||||
static { |
||||
OPTION_MAP.put(DEFAULT_OPTION, OPTION_DEFAULT); |
||||
OPTION_MAP.put(YES_NO_OPTION, OPTION_YES_NO); |
||||
OPTION_MAP.put(YES_NO_CANCEL_OPTION, OPTION_YES_NO_CANCEL); |
||||
OPTION_MAP.put(OK_CANCEL_OPTION, OPTION_OK_CANCEL); |
||||
} |
||||
|
||||
private final static String MESSAGE_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"); |
||||
private final static String CONFIRM_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"); |
||||
private final static String INPUT_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"); |
||||
|
||||
/** |
||||
* 使用默认 标题 和 消息类型 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, MESSAGE_DIALOG_TITLE, |
||||
INFORMATION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int messageType) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, title, messageType, null); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 选项类型、选项 和 初始选项 的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int messageType, Icon icon) |
||||
throws HeadlessException { |
||||
showMessageDialog(parentComponent, message, title, DEFAULT_OPTION, |
||||
messageType, icon, OPTION_DEFAULT, null); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的消息提示弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param options 选项 |
||||
* @param initialValue 初始选项 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static void showMessageDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, |
||||
Icon icon, Object[] options, Object initialValue) |
||||
throws HeadlessException { |
||||
showOptionDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, initialValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题 和 选项类型 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message) |
||||
throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, |
||||
CONFIRM_DIALOG_TITLE, |
||||
YES_NO_CANCEL_OPTION); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 消息类型 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType) throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
QUESTION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType) |
||||
throws HeadlessException { |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
messageType, null); |
||||
} |
||||
|
||||
/** |
||||
* 根据 选项类型 获取对应 选项 ,且使用默认 初始选项 的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, Icon icon) |
||||
throws HeadlessException { |
||||
String[] options = OPTION_MAP.get(optionType); |
||||
return showConfirmDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, options[0]); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的确认弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 具体的提示消息 |
||||
* @param title 标题 |
||||
* @param optionType 选项类型 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param options 选项 |
||||
* @param initialValue 初始选项 |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static int showConfirmDialog(Component parentComponent, Object message, |
||||
String title, int optionType, int messageType, Icon icon, |
||||
Object[] options, Object initialValue) |
||||
throws HeadlessException { |
||||
return showOptionDialog(parentComponent, message, title, optionType, |
||||
messageType, icon, options, initialValue); |
||||
} |
||||
|
||||
/** |
||||
* 指定消息内容的输入弹出框 |
||||
* @param message 消息内容 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Object message) |
||||
throws HeadlessException { |
||||
return showInputDialog(null, message); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题 和 消息类型 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, |
||||
Object message) throws HeadlessException { |
||||
return showInputDialog(parentComponent, message, INPUT_DIALOG_TITLE, QUESTION_MESSAGE); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 标题、消息类型、Icon 和 选项 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息类型 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, Object message, |
||||
Object initialSelectionValue) { |
||||
return (String)showInputDialog(parentComponent, message, |
||||
INPUT_DIALOG_TITLE, QUESTION_MESSAGE, null, null, |
||||
initialSelectionValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 父容器、消息内容 和 初始选项 的输入弹出框 |
||||
* @param message 消息内容 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
*/ |
||||
public static String showInputDialog(Object message, Object initialSelectionValue) { |
||||
return showInputDialog(null, message, initialSelectionValue); |
||||
} |
||||
|
||||
/** |
||||
* 使用默认 Icon、选项 和 初始选项 的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static String showInputDialog(Component parentComponent, |
||||
Object message, String title, int messageType) |
||||
throws HeadlessException { |
||||
return (String)showInputDialog(parentComponent, message, title, |
||||
messageType, null, null, null); |
||||
} |
||||
|
||||
/** |
||||
* 自定义的输入弹出框 |
||||
* @param parentComponent 父容器 |
||||
* @param message 消息内容 |
||||
* @param title 标题 |
||||
* @param messageType 消息类型 |
||||
* @param icon 图标 |
||||
* @param selectionValues 选项 |
||||
* @param initialSelectionValue 初始选项 |
||||
* @return |
||||
* @throws HeadlessException |
||||
*/ |
||||
public static Object showInputDialog(Component parentComponent, |
||||
Object message, String title, int messageType, Icon icon, |
||||
Object[] selectionValues, Object initialSelectionValue) |
||||
throws HeadlessException { |
||||
JOptionPane pane = new JOptionPane(message, messageType, |
||||
OK_CANCEL_OPTION, icon, |
||||
OPTION_OK_CANCEL, null); |
||||
|
||||
pane.setWantsInput(true); |
||||
pane.setSelectionValues(selectionValues); |
||||
pane.setInitialSelectionValue(initialSelectionValue); |
||||
pane.setComponentOrientation(((parentComponent == null) ? |
||||
getRootFrame() : parentComponent).getComponentOrientation()); |
||||
|
||||
int style = Reflect.on(JOptionPane.class).call("styleFromMessageType", messageType).get(); |
||||
JDialog dialog = Reflect.on(pane).call("createDialog", parentComponent, title, style).get(); |
||||
|
||||
pane.selectInitialValue(); |
||||
dialog.show(); |
||||
dialog.dispose(); |
||||
|
||||
Object value = pane.getInputValue(); |
||||
|
||||
if (value == UNINITIALIZED_VALUE) { |
||||
return null; |
||||
} |
||||
return value; |
||||
} |
||||
|
||||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* 移动端书签样式扩展接口 |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/23 |
||||
*/ |
||||
public interface MobileBookMarkStyleProvider extends Mutable { |
||||
|
||||
String XML_TAG = "MobileBookMarkStyleProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 书签样式 |
||||
* @return |
||||
*/ |
||||
Class<? extends MobileBookMarkStyle> classForMobileBookMarkStyle(); |
||||
|
||||
/** |
||||
* 书签样式面板 |
||||
* @return |
||||
*/ |
||||
Class<? extends BasicBeanPane<MobileBookMarkStyle>> classForMobileBookMarkStyleAppearance(); |
||||
|
||||
String displayName(); |
||||
|
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.MobileBookMarkStyleProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/24 |
||||
*/ |
||||
@API(level = MobileBookMarkStyleProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMobileBookMarkStyleProvider extends AbstractProvider implements MobileBookMarkStyleProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/24 |
||||
*/ |
||||
public class DefaultMobileBookMarkStyleCustomDefinePane extends BasicBeanPane<MobileBookMarkStyle> { |
||||
|
||||
@Override |
||||
public void populateBean(MobileBookMarkStyle ob) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public MobileBookMarkStyle updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.fun.impl.AbstractMobileBookMarkStyleProvider; |
||||
import com.fr.form.ui.mobile.impl.DefaultMobileBookMarkStyle; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/24 |
||||
*/ |
||||
public class DefaultMobileBookMarkStyleProvider extends AbstractMobileBookMarkStyleProvider { |
||||
|
||||
@Override |
||||
public Class<? extends MobileBookMarkStyle> classForMobileBookMarkStyle() { |
||||
return DefaultMobileBookMarkStyle.class; |
||||
} |
||||
|
||||
@Override |
||||
public Class<? extends BasicBeanPane<MobileBookMarkStyle>> classForMobileBookMarkStyleAppearance() { |
||||
return DefaultMobileBookMarkStyleCustomDefinePane.class; |
||||
} |
||||
|
||||
@Override |
||||
public String displayName() { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_None_BookMark_Style"); |
||||
} |
||||
} |
@ -0,0 +1,57 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.fun.MobileBookMarkStyleProvider; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.invoke.Reflect; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/23 |
||||
*/ |
||||
public class MobileBookMarkStyleDefinePane extends BasicBeanPane<MobileBookMarkStyle> { |
||||
|
||||
private BasicBeanPane<MobileBookMarkStyle> customDefinePane; |
||||
private String displayName; |
||||
|
||||
MobileBookMarkStyleDefinePane(MobileBookMarkStyleProvider bookMarkStyleProvider) { |
||||
this.customDefinePane = Reflect.on( |
||||
bookMarkStyleProvider.classForMobileBookMarkStyleAppearance()).create().get(); |
||||
this.displayName = bookMarkStyleProvider.displayName(); |
||||
initComponent(); |
||||
} |
||||
|
||||
private void initComponent() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
JPanel settingPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
if (!ComparatorUtils.equals(displayName, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_None_BookMark_Style"))) { |
||||
UILabel hintLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Hint")); |
||||
hintLabel.setForeground(Color.GRAY); |
||||
settingPane.add(hintLabel, BorderLayout.NORTH); |
||||
} |
||||
settingPane.add(this.customDefinePane, BorderLayout.CENTER); |
||||
this.add(settingPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(MobileBookMarkStyle ob) { |
||||
this.customDefinePane.populateBean(ob); |
||||
} |
||||
|
||||
@Override |
||||
public MobileBookMarkStyle updateBean() { |
||||
return this.customDefinePane.updateBean(); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "MobileBookMarkStyleDefinePane"; |
||||
} |
||||
} |
@ -0,0 +1,136 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.ExtraDesignClassManager; |
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.fun.MobileBookMarkStyleProvider; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.form.ui.mobile.MobileBookMarkStyle; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
import java.util.ArrayList; |
||||
import java.util.Collections; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/23 |
||||
*/ |
||||
public class MobileBookMarkStylePane extends BasicBeanPane<MobileBookMarkStyle> { |
||||
|
||||
public static ListCellRenderer renderer = new DefaultListCellRenderer() { |
||||
@Override |
||||
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, |
||||
boolean cellHasFocus) { |
||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
||||
if (value instanceof MobileBookMarkStyle) { |
||||
this.setText((value.toString())); |
||||
} |
||||
return this; |
||||
} |
||||
}; |
||||
|
||||
private DefaultListModel<String> listModel; |
||||
private JList bookMarkList; |
||||
private JPanel rightPane; |
||||
private CardLayout card; |
||||
private Map<String, BasicBeanPane<MobileBookMarkStyle>> map = new HashMap<>(); |
||||
|
||||
public MobileBookMarkStylePane() { |
||||
initComponent(); |
||||
} |
||||
|
||||
private void initComponent() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.listModel = new DefaultListModel<>(); |
||||
this.card = new CardLayout(); |
||||
this.rightPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
||||
this.rightPane.setLayout(card); |
||||
initDefaultAndExtraPanel(); |
||||
initLeftListPanel(); |
||||
initRightPanel(); |
||||
} |
||||
|
||||
private void initDefaultAndExtraPanel() { |
||||
List<MobileBookMarkStyleProvider> list = getMobileBookMarkStyleProvider(); |
||||
for (MobileBookMarkStyleProvider bookMarkStyleProvider : list) { |
||||
String displayName = bookMarkStyleProvider.displayName(); |
||||
MobileBookMarkStyleDefinePane mobileBookMarkStyleDefinePane = new MobileBookMarkStyleDefinePane( |
||||
bookMarkStyleProvider); |
||||
listModel.addElement(displayName); |
||||
rightPane.add(displayName, mobileBookMarkStyleDefinePane); |
||||
map.put(displayName, mobileBookMarkStyleDefinePane); |
||||
} |
||||
} |
||||
|
||||
private void initLeftListPanel() { |
||||
bookMarkList = new JList<>(listModel); |
||||
bookMarkList.setCellRenderer(renderer); |
||||
bookMarkList.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
card.show(rightPane, (String) bookMarkList.getSelectedValue()); |
||||
} |
||||
}); |
||||
JPanel leftPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
leftPanel.add(bookMarkList, BorderLayout.CENTER); |
||||
leftPanel.setPreferredSize(new Dimension(100, 500)); |
||||
this.add(leftPanel, BorderLayout.WEST); |
||||
} |
||||
|
||||
private void initRightPanel() { |
||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
centerPane.setPreferredSize(new Dimension(500, 500)); |
||||
centerPane.add(rightPane, BorderLayout.CENTER); |
||||
this.add(centerPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
|
||||
private List<MobileBookMarkStyleProvider> getMobileBookMarkStyleProvider() { |
||||
DefaultMobileBookMarkStyleProvider defaultMobileBookMarkStyleProvider = new DefaultMobileBookMarkStyleProvider(); |
||||
Set<MobileBookMarkStyleProvider> mobileBookMarkStyleProviders = ExtraDesignClassManager.getInstance().getArray( |
||||
MobileBookMarkStyleProvider.XML_TAG); |
||||
List<MobileBookMarkStyleProvider> list = new ArrayList<>(); |
||||
list.add(defaultMobileBookMarkStyleProvider); |
||||
list.addAll(mobileBookMarkStyleProviders); |
||||
return Collections.unmodifiableList(list); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void populateBean(MobileBookMarkStyle mobileBookMarkStyle) { |
||||
if (mobileBookMarkStyle != null) { |
||||
List<MobileBookMarkStyleProvider> bookMarkStyleProviders = getMobileBookMarkStyleProvider(); |
||||
int i = 0; |
||||
for (MobileBookMarkStyleProvider bookMarkStyleProvider : bookMarkStyleProviders) { |
||||
if (mobileBookMarkStyle.getClass() == bookMarkStyleProvider.classForMobileBookMarkStyle()) { |
||||
String displayName = bookMarkStyleProvider.displayName(); |
||||
bookMarkList.setSelectedIndex(i); |
||||
map.get(displayName).populateBean(mobileBookMarkStyle); |
||||
card.show(rightPane, displayName); |
||||
return; |
||||
} |
||||
i++; |
||||
} |
||||
} |
||||
bookMarkList.setSelectedIndex(0); |
||||
} |
||||
|
||||
@Override |
||||
public MobileBookMarkStyle updateBean() { |
||||
return map.get(bookMarkList.getSelectedValue()).updateBean(); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fr.design.mainframe.widget.wrappers; |
||||
|
||||
import com.fr.design.Exception.ValidationException; |
||||
import com.fr.design.designer.properties.Decoder; |
||||
import com.fr.design.designer.properties.Encoder; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2019/12/24 |
||||
*/ |
||||
public class MobileBookMarkStyleWrapper implements Encoder, Decoder { |
||||
@Override |
||||
public Object decode(String txt) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void validate(String txt) throws ValidationException { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public String encode(Object v) { |
||||
if (v == null) { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_None_BookMark_Style"); |
||||
} |
||||
return v.toString(); |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue