Browse Source

Pull request #2691: MOBILE-29820 移动端tab样式页面缺少滚动条

Merge in DESIGN/design from ~HANS/design:release/10.0 to release/10.0

* commit '7b53cb3a58761047bfb32278a0f5585288517c8f':
  MOBILE-29820 移动端tab样式页面缺少滚动条 添加滚动条 最外层直接使用JPanel,没有布局约束导致布局异常,需要调整
feature/big-screen
Hans 4 years ago
parent
commit
005bbf85b9
  1. 21
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

21
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -24,6 +24,7 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
@ -40,10 +41,12 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
private MobileTabCommonSettingPane mobileTabCommonSettingPane;
private JPanel contentJPanel;
private BasicScrollPane scrollPane;
private JPanel holder;
private Dimension dimension;
public TabMobileWidgetDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
contentJPanel = new JPanel();
contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane();
scrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
@ -79,7 +82,18 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template"));
templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData()));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE);
JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane();
holder = new JPanel(new BorderLayout()) {
@Override
public Dimension getPreferredSize() {
if (dimension == null) {
return super.getPreferredSize();
} else {
Dimension defaultDimension = super.getPreferredSize();
defaultDimension.width = dimension.width;
return defaultDimension;
}
}
};
holder.add(jPanel, BorderLayout.NORTH);
JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
if (!shouldHidePadding(designer)) {
@ -111,6 +125,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
public void populate(FormDesigner designer) {
WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData();
MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle();
if (dimension == null) {
dimension = holder.getPreferredSize();
}
templateStyleEditor.setValue(mobileTemplateStyle);
// 数据 populate 完成后,再设置监听
this.bindListeners2Widgets();

Loading…
Cancel
Save