Browse Source

REPORT-3734 [9.0一轮回归]设计器控件管理打不开

master
kerry 7 years ago
parent
commit
7b7c2fed3b
  1. 19
      designer/src/com/fr/design/widget/ValueWidgetPane.java
  2. 24
      designer/src/com/fr/design/widget/WidgetPane.java
  3. 4
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

19
designer/src/com/fr/design/widget/ValueWidgetPane.java

@ -1,9 +1,11 @@
package com.fr.design.widget; package com.fr.design.widget;
import javax.swing.JPanel; import javax.swing.*;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.form.ui.DataControl; import com.fr.form.ui.DataControl;
@ -11,6 +13,8 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetValue; import com.fr.form.ui.WidgetValue;
import com.fr.general.Inter; import com.fr.general.Inter;
import java.awt.*;
public class ValueWidgetPane extends WidgetPane { public class ValueWidgetPane extends WidgetPane {
private JPanel widgetValuePane; private JPanel widgetValuePane;
private WidgetValueEditor widgetValueEditor; private WidgetValueEditor widgetValueEditor;
@ -19,13 +23,22 @@ public class ValueWidgetPane extends WidgetPane {
@Override @Override
protected void initComponents(ElementCasePane pane) { protected void initComponents(ElementCasePane pane) {
super.initComponents(pane); super.initComponents(pane);
}
public JPanel initNorthPane(){
label = new UILabel(" " + Inter.getLocText(new String[]{"Widget", "Value"})+ ":"); label = new UILabel(" " + Inter.getLocText(new String[]{"Widget", "Value"})+ ":");
northPane.add(label);
label.setVisible(false); label.setVisible(false);
widgetValuePane = new JPanel(); widgetValuePane = new JPanel();
widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout()); widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout());
northPane.add(widgetValuePane); double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), editorTypeComboBox, label,widgetValuePane},
};
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return jPanel;
} }
@Override @Override

24
designer/src/com/fr/design/widget/WidgetPane.java

@ -32,7 +32,7 @@ import java.util.Vector;
*/ */
public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener { public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener {
private EditorTypeComboBox editorTypeComboBox; protected EditorTypeComboBox editorTypeComboBox;
private CellWidgetCardPane cellEditorCardPane; private CellWidgetCardPane cellEditorCardPane;
private boolean shouldFireSelectedEvent = true; private boolean shouldFireSelectedEvent = true;
protected JPanel northPane; protected JPanel northPane;
@ -55,7 +55,18 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
editorTypeComboBox = new EditorTypeComboBox(pane != null); editorTypeComboBox = new EditorTypeComboBox(pane != null);
editorTypeComboBox.setPreferredSize(new Dimension(155, 30)); editorTypeComboBox.setPreferredSize(new Dimension(155, 30));
editorTypeComboBox.setMaximumRowCount(16); editorTypeComboBox.setMaximumRowCount(16);
northPane = initNorthPane();
northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15));
this.add(northPane, BorderLayout.NORTH);
editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
}
public JPanel initNorthPane(){
UILabel emptyLabel = new UILabel(); UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
@ -66,15 +77,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), emptyLabel, editorTypeComboBox}, new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), emptyLabel, editorTypeComboBox},
}; };
northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15)); return jPanel;
this.add(northPane, BorderLayout.NORTH);
editorTypeComboBox.addItemListener(this);
cellEditorCardPane = new CellWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
} }
protected JPanel createContentPane() { protected JPanel createContentPane() {

4
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -179,10 +179,10 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
topToolBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); topToolBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f, 155}; double[] columnSize = { p, f};
double[] rowSize = {p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), null, topToolBar}, new Component[]{new UILabel(getAddItemText()), topToolBar},
}; };
JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));

Loading…
Cancel
Save