Browse Source
* commit '5108f6b3538990fa7427f62fc5813aa27beaae52': (103 commits) REPORT-20318 sonar问题修复-zack 无JIRA任务 标记开放类 无JIRA任务 sonar问题修复 无JIRA任务 标记开放类 无JIRA任务 标记开放类 REPORT-20329 sonar问题修复 MOBILE-21673 & MOBILE-21669 把移动端组件默认背景改为Backgroud类型,同时tilteBorder颜色改为视觉要求颜色 REPORT-19466 【匹配移动端】组件级控制选中等 sonar问题修复,无jira任务 REPORT-20322 sonar问题修复,无jira任务 REPORT-21203 去掉多余的实现接口 REPORT-21203 【水印密度】水印密度框输入特殊符号--,输入小数应该不让允许 无jira任务,sonar问题修复 报表REPORT-20320 sonar问题修复 REPORT-20328 sonar REPORT-20323 sonar问题修复 无jira任务,sonar问题修复 无jira任务 sonar问题修复 REPORT-19466 【匹配移动端】组件级控制选中等 REPORT-20320 sonar问题修复 ...research/11.0
zheng
5 years ago
209 changed files with 6661 additions and 4873 deletions
@ -0,0 +1,39 @@
|
||||
package com.fr.design.constants; |
||||
|
||||
import com.fr.event.Event; |
||||
import com.fr.event.EventDispatcher; |
||||
import com.fr.event.Null; |
||||
|
||||
/** |
||||
* 设计器启动事件类型 |
||||
* |
||||
* @author vito |
||||
* @date 2019-06-18 |
||||
*/ |
||||
public enum DesignerLaunchStatus implements Event<Null> { |
||||
/** |
||||
* 初始化环境完成 |
||||
*/ |
||||
WORKSPACE_INIT_COMPLETE, |
||||
|
||||
/** |
||||
* 设计器模块启动完成 |
||||
*/ |
||||
DESIGNER_INIT_COMPLETE, |
||||
|
||||
/** |
||||
* 启动完成 |
||||
*/ |
||||
OPEN_LAST_FILE_COMPLETE; |
||||
|
||||
private static DesignerLaunchStatus status; |
||||
|
||||
public static DesignerLaunchStatus getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public static void setStatus(DesignerLaunchStatus state) { |
||||
status = state; |
||||
EventDispatcher.asyncFire(DesignerLaunchStatus.getStatus()); |
||||
} |
||||
} |
@ -1,8 +1,11 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
import com.fr.common.annotations.Open; |
||||
|
||||
@Open |
||||
public interface DialogActionListener { |
||||
|
||||
public void doOk(); |
||||
void doOk(); |
||||
|
||||
public void doCancel(); |
||||
void doCancel(); |
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* 移动端组件样式扩展接口 |
||||
*/ |
||||
public interface MobileWidgetStyleProvider extends Mutable { |
||||
|
||||
String XML_TAG = "MobileWidgetStyleProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
Class<? extends MobileStyle> classForMobileStyle(); |
||||
|
||||
Class<? extends MobileStyleCustomDefinePane> classForWidgetAppearance(); |
||||
|
||||
String xTypeForWidget(); |
||||
|
||||
String displayName(); |
||||
|
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.MobileWidgetStyleProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
@API(level = MobileWidgetStyleProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMobileWidgetStyleProvider extends AbstractProvider implements MobileWidgetStyleProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.design.gui.ispinner; |
||||
|
||||
import com.fr.design.gui.itextfield.UIIntNumberField; |
||||
import com.fr.design.gui.itextfield.UINumberField; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : Hugh.C |
||||
* Date: 19-08-28 |
||||
* Time: 下午2:19 |
||||
*/ |
||||
public class UnsignedIntUISpinner extends UISpinner { |
||||
|
||||
|
||||
public UnsignedIntUISpinner(double minValue, double maxValue, double dierta) { |
||||
super(minValue, maxValue, dierta); |
||||
} |
||||
|
||||
public UnsignedIntUISpinner(double minValue, double maxValue, double dierta, double defaultValue) { |
||||
super(minValue, maxValue, dierta, defaultValue); |
||||
} |
||||
|
||||
@Override |
||||
protected UINumberField initNumberField() { |
||||
return new UIIntNumberField() { |
||||
public boolean shouldResponseChangeListener() { |
||||
return false; |
||||
} |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,77 @@
|
||||
package com.fr.design.gui.itree.filetree; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.ExtraDesignClassManager; |
||||
import com.fr.design.mainframe.App; |
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.plugin.context.PluginContext; |
||||
import com.fr.plugin.injectable.PluginModule; |
||||
import com.fr.plugin.manage.PluginFilter; |
||||
import com.fr.plugin.observer.PluginEvent; |
||||
import com.fr.plugin.observer.PluginEventListener; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Set; |
||||
import java.util.concurrent.locks.ReadWriteLock; |
||||
import java.util.concurrent.locks.ReentrantReadWriteLock; |
||||
|
||||
/** |
||||
* Created by alex sung on 2019/7/23. |
||||
*/ |
||||
public class FileNodeConstants { |
||||
|
||||
private static List<String> supportFileType; |
||||
private static ReadWriteLock rwl = new ReentrantReadWriteLock(); |
||||
|
||||
private FileNodeConstants() { |
||||
} |
||||
|
||||
static { |
||||
initSupportedTypes(); |
||||
|
||||
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { |
||||
@Override |
||||
public void on(PluginEvent pluginEvent) { |
||||
initSupportedTypes(); |
||||
} |
||||
}, new PluginFilter() { |
||||
@Override |
||||
public boolean accept(PluginContext pluginContext) { |
||||
return pluginContext.contain(PluginModule.ExtraDesign); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private static void addAppExtensions(String[] extensions) { |
||||
for (int i = 0, size = extensions.length; i < size; i++) { |
||||
if (!supportFileType.contains(extensions[i])) { |
||||
supportFileType.add(extensions[i]); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private static void initSupportedTypes() { |
||||
try { |
||||
rwl.writeLock().lock(); |
||||
supportFileType = new ArrayList<>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); |
||||
//通过插件扩展的
|
||||
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); |
||||
for (App app : apps) { |
||||
addAppExtensions(app.defaultExtensions()); |
||||
} |
||||
} finally { |
||||
rwl.writeLock().unlock(); |
||||
} |
||||
} |
||||
|
||||
public static String[] getSupportFileTypes() { |
||||
try { |
||||
rwl.readLock().lock(); |
||||
return supportFileType.toArray(new String[0]); |
||||
} finally { |
||||
rwl.readLock().unlock(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
public class DefaultMobileStyleCustomDefinePane extends MobileStyleCustomDefinePane { |
||||
|
||||
|
||||
public DefaultMobileStyleCustomDefinePane(Widget widget) { |
||||
super(widget); |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createPreviewPane() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(MobileStyle ob) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public MobileStyle updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected void init() { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.fun.impl.AbstractMobileWidgetStyleProvider; |
||||
import com.fr.form.ui.mobile.DefaultMobileStyle; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.locale.InterProviderFactory; |
||||
|
||||
public class DefaultMobileWidgetStyleProvider extends AbstractMobileWidgetStyleProvider { |
||||
|
||||
@Override |
||||
public Class<? extends MobileStyle> classForMobileStyle() { |
||||
return DefaultMobileStyle.class; |
||||
} |
||||
|
||||
@Override |
||||
public Class<? extends MobileStyleCustomDefinePane> classForWidgetAppearance() { |
||||
return DefaultMobileStyleCustomDefinePane.class; |
||||
} |
||||
|
||||
@Override |
||||
public String xTypeForWidget() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public String displayName() { |
||||
return InterProviderFactory.getProvider().getLocText("Fine-Engine_Report_DEFAULT"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
public abstract class MobileStyleCustomDefinePane extends BasicBeanPane<MobileStyle> { |
||||
|
||||
protected Widget widget; |
||||
|
||||
public MobileStyleCustomDefinePane(Widget widget) { |
||||
this.widget = widget; |
||||
init(); |
||||
} |
||||
|
||||
protected abstract JPanel createPreviewPane(); |
||||
|
||||
protected abstract void init(); |
||||
|
||||
} |
@ -0,0 +1,122 @@
|
||||
package com.fr.design.mainframe.mobile.ui; |
||||
|
||||
import com.fr.base.background.ColorBackground; |
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.style.color.NewColorSelectBox; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.general.FRFont; |
||||
import com.fr.invoke.Reflect; |
||||
|
||||
import javax.swing.*; |
||||
import javax.swing.border.TitledBorder; |
||||
import javax.swing.event.ChangeEvent; |
||||
import javax.swing.event.ChangeListener; |
||||
import java.awt.*; |
||||
|
||||
public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> { |
||||
|
||||
private Widget widget; |
||||
private MobileStyleCustomDefinePane customBeanPane; |
||||
private Class<? extends MobileStyle> mobileStyleClazz; |
||||
private NewColorSelectBox colorSelectBox; |
||||
private Color titleColor = new Color(47, 142, 241); |
||||
|
||||
MobileStyleDefinePane(Widget widget, Class<? extends MobileStyleCustomDefinePane> customBeanPaneClass, |
||||
Class<? extends MobileStyle> mobileStyleClazz) { |
||||
this.widget = widget; |
||||
this.customBeanPane = Reflect.on(customBeanPaneClass).create(widget).get(); |
||||
this.mobileStyleClazz = mobileStyleClazz; |
||||
init(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(MobileStyle ob) { |
||||
this.customBeanPane.populateBean(ob); |
||||
if(ob.getBackground() != null) { |
||||
colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public MobileStyle updateBean() { |
||||
MobileStyle mobileStyle = Reflect.on(mobileStyleClazz).create().get(); |
||||
this.widget.setMobileStyle(mobileStyle); |
||||
this.customBeanPane.updateBean(); |
||||
mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); |
||||
return mobileStyle; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
|
||||
private void init() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
createGeneralPane(); |
||||
createCustomPane(); |
||||
} |
||||
|
||||
private void createGeneralPane() { |
||||
createPreviewPane(); |
||||
createBackgroundPane(); |
||||
} |
||||
|
||||
private void createPreviewPane() { |
||||
JPanel mobileStylePreviewPane = this.customBeanPane.createPreviewPane(); |
||||
if(mobileStylePreviewPane != null) { |
||||
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
TitledBorder titledBorder = createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview")); |
||||
previewPane.setBorder(titledBorder); |
||||
previewPane.setPreferredSize(new Dimension(500, 83)); |
||||
previewPane.add(mobileStylePreviewPane, BorderLayout.CENTER); |
||||
this.add(previewPane, BorderLayout.NORTH); |
||||
} |
||||
} |
||||
|
||||
private void createBackgroundPane() { |
||||
|
||||
JPanel backgroundPane = new JPanel(); |
||||
backgroundPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 5)); |
||||
backgroundPane.setPreferredSize(new Dimension(500, 65)); |
||||
|
||||
TitledBorder titledBorder = createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_Common_Attribute")); |
||||
backgroundPane.setBorder(titledBorder); |
||||
|
||||
UILabel colorSelectLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Widget_Background"), UILabel.RIGHT); |
||||
colorSelectLabel.setPreferredSize(new Dimension(65, 20)); |
||||
|
||||
colorSelectBox = new NewColorSelectBox(152); |
||||
colorSelectBox.addSelectChangeListener(new ChangeListener() { |
||||
@Override |
||||
public void stateChanged(ChangeEvent e) { |
||||
} |
||||
}); |
||||
|
||||
backgroundPane.add(colorSelectLabel); |
||||
backgroundPane.add(colorSelectBox); |
||||
|
||||
this.add(backgroundPane, BorderLayout.NORTH); |
||||
} |
||||
|
||||
private void createCustomPane() { |
||||
JPanel configPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
TitledBorder titledBorder = createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Set")); |
||||
configPane.setBorder(titledBorder); |
||||
|
||||
configPane.add(this.customBeanPane, BorderLayout.CENTER); |
||||
|
||||
this.add(configPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
private TitledBorder createTitledBorder(String title) { |
||||
TitledBorder titledBorder = GUICoreUtils.createTitledBorder(title, titleColor); |
||||
titledBorder.setTitleFont(FRFont.getInstance("PingFangSC-Regular", Font.PLAIN, 12)); |
||||
return titledBorder; |
||||
} |
||||
} |
@ -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.dialog.BasicPane; |
||||
import com.fr.design.fun.MobileWidgetStyleProvider; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.container.WScaleLayout; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.form.ui.widget.CRBoundsWidget; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.ArrayUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
public class MobileStylePane extends BasicPane { |
||||
|
||||
private Widget widget; |
||||
private DefaultListModel<String> listModel; |
||||
private JPanel right; |
||||
private CardLayout card; |
||||
private JList styleList; |
||||
private Map<String, BasicBeanPane<MobileStyle>> map = new HashMap<>(); |
||||
|
||||
public MobileStylePane(Widget widget) { |
||||
if(widget instanceof WScaleLayout) { |
||||
this.widget = ((CRBoundsWidget)((WScaleLayout) widget).getBoundsWidget()).getWidget(); |
||||
} else { |
||||
this.widget = widget; |
||||
} |
||||
init(); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
|
||||
public void populate(MobileStyle mobileStyle) { |
||||
if(mobileStyle != null) { |
||||
MobileWidgetStyleProvider[] styleProviders = getMobileWidgetStyleProviders(); |
||||
for(int i = 0; i < styleProviders.length; i ++) { |
||||
if(mobileStyle.getClass() == styleProviders[i].classForMobileStyle()) { |
||||
String displayName = styleProviders[i].displayName(); |
||||
styleList.setSelectedIndex(i); |
||||
map.get(displayName).populateBean(mobileStyle); |
||||
card.show(right, displayName); |
||||
return; |
||||
} |
||||
} |
||||
} |
||||
styleList.setSelectedIndex(0); |
||||
} |
||||
|
||||
public MobileStyle update() { |
||||
return map.get(styleList.getSelectedValue()).updateBean(); |
||||
} |
||||
|
||||
private void init() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
listModel = new DefaultListModel<>(); |
||||
card = new CardLayout(); |
||||
right = FRGUIPaneFactory.createCardLayout_S_Pane(); |
||||
right.setLayout(card); |
||||
MobileWidgetStyleProvider[] styleProviders = getMobileWidgetStyleProviders(); |
||||
for(MobileWidgetStyleProvider styleProvider: styleProviders) { |
||||
this.addProvider2View(styleProvider); |
||||
} |
||||
this.addWestList(); |
||||
this.addCenterConfig(); |
||||
} |
||||
|
||||
private void addWestList() { |
||||
styleList = new JList<>(listModel); |
||||
styleList.setCellRenderer(render); |
||||
styleList.addMouseListener(new MouseAdapter() { |
||||
public void mouseClicked(MouseEvent e) { |
||||
String selectedValue = (String)styleList.getSelectedValue(); |
||||
card.show(right, selectedValue); |
||||
} |
||||
}); |
||||
JPanel westPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
westPane.add(styleList, BorderLayout.CENTER); |
||||
westPane.setPreferredSize(new Dimension(100, 500)); |
||||
this.add(westPane, BorderLayout.WEST); |
||||
} |
||||
|
||||
private void addCenterConfig() { |
||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
JPanel attrConfPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
centerPane.setPreferredSize(new Dimension(500, 500)); |
||||
attrConfPane.add(right, BorderLayout.CENTER); |
||||
centerPane.add(attrConfPane, BorderLayout.CENTER); |
||||
this.add(centerPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
private void addProvider2View(MobileWidgetStyleProvider styleProvider) { |
||||
String displayName = styleProvider.displayName(); |
||||
Class<? extends MobileStyleCustomDefinePane> appearanceClazz = styleProvider.classForWidgetAppearance(); |
||||
Class<? extends MobileStyle> mobileStyleClazz = styleProvider.classForMobileStyle(); |
||||
|
||||
listModel.addElement(displayName); |
||||
try { |
||||
BasicBeanPane<MobileStyle> mobileStyleBasicBeanPane = new MobileStyleDefinePane(widget, appearanceClazz, mobileStyleClazz); |
||||
right.add(displayName, mobileStyleBasicBeanPane); |
||||
map.put(displayName, mobileStyleBasicBeanPane); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
|
||||
private static ListCellRenderer render = 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 MobileStyle) { |
||||
MobileStyle l = (MobileStyle) value; |
||||
this.setText(l.toString()); |
||||
} |
||||
return this; |
||||
} |
||||
}; |
||||
|
||||
private MobileWidgetStyleProvider[] getMobileWidgetStyleProviders() { |
||||
DefaultMobileWidgetStyleProvider defaultMobileWidgetStyleProvider = new DefaultMobileWidgetStyleProvider(); |
||||
MobileWidgetStyleProvider[] styleProviders = ExtraDesignClassManager.getInstance().getMobileStyleOfWidget(widget.getXType()); |
||||
styleProviders = ArrayUtils.insert(0, styleProviders, defaultMobileWidgetStyleProvider); |
||||
return styleProviders; |
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.mainframe.widget.accessibles; |
||||
|
||||
import com.fr.design.dialog.BasicDialog; |
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.mainframe.mobile.ui.MobileStylePane; |
||||
import com.fr.design.mainframe.widget.wrappers.MobileStyleWrapper; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
|
||||
import javax.swing.SwingUtilities; |
||||
import java.awt.Dimension; |
||||
|
||||
public class AccessibleMobileStyleEditor extends UneditableAccessibleEditor { |
||||
|
||||
private MobileStylePane stylePane; |
||||
private static final Dimension DEFAULT_DIMENSION = new Dimension(600, 400); |
||||
|
||||
public AccessibleMobileStyleEditor(MobileStylePane stylePane) { |
||||
super(new MobileStyleWrapper()); |
||||
this.stylePane = stylePane; |
||||
} |
||||
|
||||
@Override |
||||
protected void showEditorPane() { |
||||
stylePane.setPreferredSize(DEFAULT_DIMENSION); |
||||
BasicDialog dlg = stylePane.showWindow(SwingUtilities.getWindowAncestor(this)); |
||||
dlg.addDialogActionListener(new DialogActionAdapter() { |
||||
@Override |
||||
public void doOk() { |
||||
setValue(stylePane.update()); |
||||
fireStateChanged(); |
||||
} |
||||
}); |
||||
stylePane.populate((MobileStyle) getValue()); |
||||
dlg.setVisible(true); |
||||
} |
||||
} |
@ -0,0 +1,26 @@
|
||||
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; |
||||
import com.fr.locale.InterProviderFactory; |
||||
|
||||
public class MobileStyleWrapper 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 InterProviderFactory.getProvider().getLocText("Fine-Engine_Report_DEFAULT"); |
||||
} |
||||
return v.toString(); |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue