Browse Source
* commit '079530d6a9afb8790ce37e8e829508232773add0': REPORT-19464 【匹配移动端】TAB下菜单式图标优化2 REPORT-19462 REPORT-19464 【匹配移动端】TAB下菜单式图标优化2 REPORT-20328 sonar REPORT-19464 【匹配移动端】TAB下菜单式图标优化2 REPORT-19464 【匹配移动端】TAB下菜单式图标优化2 无jira任务,sonar问题修复 REPORT-20868 sonar问题修复 REPORT-20329 sonar问题修复 无JIRA任务 抽象实体类,给SDK做准备 无JIRA任务 修复编译错误 删掉sdk 冲突 REPORT-19466 【匹配移动端】组件级控制选中等 REPORT-19466 【匹配移动端】组件级控制选中等 误传 无JIRA任务 开放SDK对需要开放的类的标记 REPORT-19468 【匹配移动端】H5超链标题显示处理 REPORT-19465 【匹配移动端】模板级全局控制缩放等research/11.0
vito
5 years ago
46 changed files with 511 additions and 400 deletions
@ -0,0 +1,92 @@ |
|||||||
|
package com.fr.design.widget.ui.designer.mobile.component; |
||||||
|
|
||||||
|
import com.fr.design.designer.IntervalConstants; |
||||||
|
import com.fr.design.designer.creator.XCreator; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.icombocheckbox.UIComboCheckBox; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
import com.fr.design.mainframe.WidgetPropertyPane; |
||||||
|
import com.fr.design.utils.gui.UIComponentUtils; |
||||||
|
import com.fr.design.widget.FRWidgetFactory; |
||||||
|
import com.fr.form.ui.Widget; |
||||||
|
import com.fr.form.ui.container.WSortLayout; |
||||||
|
import com.fr.stable.ArrayUtils; |
||||||
|
|
||||||
|
import javax.swing.BorderFactory; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
import java.awt.Component; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.LinkedHashMap; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Hades |
||||||
|
* @date 2019/8/14 |
||||||
|
*/ |
||||||
|
public class MobileComponentFrozenPane extends BasicPane { |
||||||
|
|
||||||
|
private UIComboCheckBox uiComboCheckBox; |
||||||
|
|
||||||
|
public MobileComponentFrozenPane() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
UILabel frozenLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Frozen")); |
||||||
|
uiComboCheckBox = new UIComboCheckBox(initData()); |
||||||
|
JPanel wrapJPanel = UIComponentUtils.wrapWithBorderLayoutPane(uiComboCheckBox); |
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{frozenLabel, wrapJPanel} |
||||||
|
}; |
||||||
|
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
||||||
|
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 10, 0)); |
||||||
|
JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||||
|
holder.add(centerPane, BorderLayout.NORTH); |
||||||
|
this.add(holder, BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
private String[] initData() { |
||||||
|
FormDesigner designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
||||||
|
XCreator selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator(); |
||||||
|
Widget selectedModel = selectedCreator != null ? selectedCreator.toData() : null; |
||||||
|
|
||||||
|
if (selectedModel == null || !selectedModel.acceptType(WSortLayout.class)) { |
||||||
|
return ArrayUtils.EMPTY_STRING_ARRAY; |
||||||
|
} |
||||||
|
|
||||||
|
List<String> widgetList = ((WSortLayout) selectedModel).getNonContainerWidgetList(); |
||||||
|
return widgetList.toArray(new String[0]); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(XCreator xCreator) { |
||||||
|
List<String> selected = new ArrayList<>(); |
||||||
|
WSortLayout wSortLayout = ((WSortLayout) xCreator.toData()); |
||||||
|
Object[] values = uiComboCheckBox.getSelectedValues(); |
||||||
|
for (Object widgetName : values) { |
||||||
|
selected.add((String) widgetName); |
||||||
|
} |
||||||
|
wSortLayout.updateFrozenWidgets(selected); |
||||||
|
} |
||||||
|
|
||||||
|
public void populate(XCreator xCreator) { |
||||||
|
WSortLayout wSortLayout = ((WSortLayout) xCreator.toData()); |
||||||
|
List<String> all = wSortLayout.getNonContainerWidgetList(); |
||||||
|
List<String> selected = wSortLayout.getFrozenWidgets(); |
||||||
|
Map<Object, Boolean> map = new LinkedHashMap<>(); |
||||||
|
for (String value : selected) { |
||||||
|
map.put(value, true); |
||||||
|
} |
||||||
|
all.removeAll(selected); |
||||||
|
for (String value : all) { |
||||||
|
map.put(value, false); |
||||||
|
} |
||||||
|
uiComboCheckBox.setSelectedValues(map); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return "ComponentFrozenPane"; |
||||||
|
} |
||||||
|
} |
@ -1,80 +0,0 @@ |
|||||||
package com.fr.sdk.designer; |
|
||||||
|
|
||||||
import com.fr.config.activator.ConfigurationActivator; |
|
||||||
import com.fr.design.env.DesignerWorkspaceGenerator; |
|
||||||
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
||||||
import com.fr.log.FineLoggerFactory; |
|
||||||
import com.fr.module.Activator; |
|
||||||
import com.fr.module.Module; |
|
||||||
import com.fr.module.tool.ActivatorToolBox; |
|
||||||
import com.fr.report.ReportActivator; |
|
||||||
import com.fr.report.RestrictionActivator; |
|
||||||
import com.fr.report.module.ReportBaseActivator; |
|
||||||
import com.fr.scheduler.SchedulerActivator; |
|
||||||
import com.fr.sdk.server.shell.ModuleShell; |
|
||||||
import com.fr.serialization.SerializationActivator; |
|
||||||
import com.fr.stable.StringUtils; |
|
||||||
import com.fr.startup.WorkspaceRegister; |
|
||||||
import com.fr.store.StateServerActivator; |
|
||||||
import com.fr.workspace.WorkContext; |
|
||||||
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
||||||
import com.fr.workspace.engine.WorkspaceActivator; |
|
||||||
import com.fr.workspace.server.ServerWorkspaceRegister; |
|
||||||
|
|
||||||
/** |
|
||||||
* 设计器SDK模块工具类,用来放一些设计器相关插件开发过程中常用的工具函数 |
|
||||||
*/ |
|
||||||
public class FineDesignUtils { |
|
||||||
|
|
||||||
/** |
|
||||||
* 创建一个连接远程服务器的模块 |
|
||||||
* @param remoteUrl 远程服务器地址 |
|
||||||
* @param username 用户名 |
|
||||||
* @param password 密码 |
|
||||||
* @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 |
|
||||||
*/ |
|
||||||
public static ModuleShell createRemoteServerModule(String remoteUrl, String username, String password) { |
|
||||||
return createRemoteServerModule(remoteUrl, username, password, StringUtils.EMPTY, StringUtils.EMPTY); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 创建一个连接远程服务器的模块 |
|
||||||
* @param remoteUrl 远程服务器地址 |
|
||||||
* @param username 用户名 |
|
||||||
* @param password 密码 |
|
||||||
* @param certPath https证书路径 |
|
||||||
* @param certSecretKey 证书秘钥 |
|
||||||
* @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 |
|
||||||
*/ |
|
||||||
public static ModuleShell createRemoteServerModule(final String remoteUrl, final String username, final String password, final String certPath, final String certSecretKey) { |
|
||||||
Module module = ActivatorToolBox.simpleLink( |
|
||||||
new WorkspaceActivator(), |
|
||||||
new SerializationActivator(), |
|
||||||
new Activator() { |
|
||||||
@Override |
|
||||||
public void start() { |
|
||||||
WorkspaceConnectionInfo connectionInfo = new WorkspaceConnectionInfo(remoteUrl, username, password, certPath, certSecretKey); |
|
||||||
try { |
|
||||||
WorkContext.switchTo(DesignerWorkspaceGenerator.generate(RemoteDesignerWorkspaceInfo.create(connectionInfo))); |
|
||||||
} catch (Exception e) { |
|
||||||
FineLoggerFactory.getLogger().error(e.getMessage(),e); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void stop() { |
|
||||||
|
|
||||||
} |
|
||||||
}, |
|
||||||
new ConfigurationActivator(), |
|
||||||
new StateServerActivator(), |
|
||||||
new SchedulerActivator(), |
|
||||||
new ReportBaseActivator(), |
|
||||||
new RestrictionActivator(), |
|
||||||
new ReportActivator(), |
|
||||||
new WorkspaceRegister(), |
|
||||||
new ServerWorkspaceRegister() |
|
||||||
); |
|
||||||
return new ModuleShell(module); |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue