Browse Source

REPORT-1344 表单报表块翻页改进并增加局部导出

master
frharry 8 years ago
parent
commit
346e7337d9
  1. 7
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  2. 40
      designer_form/src/com/fr/design/mainframe/FormEditToolBar.java
  3. 8
      designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java
  4. 14
      designer_form/src/com/fr/design/mainframe/FormToolBar.java
  5. 17
      designer_form/src/com/fr/design/mainframe/FormToolBarButton.java
  6. 42
      designer_form/src/com/fr/design/mainframe/FormToolBarPane.java
  7. 2
      designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java
  8. 26
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java
  9. 13
      designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java
  10. 13
      designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java
  11. 74
      designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java
  12. 6
      designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java

7
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -10,12 +10,9 @@ import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.ECToolBarEditor;
import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.FormProvider;
@ -105,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ECToolBarEditor.class)
new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};

40
designer_form/src/com/fr/design/mainframe/FEditToolBar.java → designer_form/src/com/fr/design/mainframe/FormEditToolBar.java

@ -36,14 +36,14 @@ import java.util.*;
/**
* Created by harry on 2017-3-2.
*/
public class FEditToolBar extends BasicPane {
public class FormEditToolBar extends BasicPane {
private JList list;
private DefaultListModel listModel;
private JPanel right;
private CardLayout card;
private ButtonPane bp;
private FToolBarButton lastButton;
private FormToolBarButton lastButton;
private Background background = null;
private UICheckBox defaultCheckBox;
@ -52,8 +52,8 @@ public class FEditToolBar extends BasicPane {
if (lastButton != null) {
lastButton.setWidget(bp.update());
}
if (list.getSelectedValue() instanceof FToolBarButton) {
lastButton = (FToolBarButton) list.getSelectedValue();
if (list.getSelectedValue() instanceof FormToolBarButton) {
lastButton = (FormToolBarButton) list.getSelectedValue();
if (lastButton.getWidget() instanceof Button) {
card.show(right, "button");
bp.populate(lastButton.getWidget());
@ -73,12 +73,12 @@ public class FEditToolBar extends BasicPane {
public void actionPerformed(ActionEvent arg0) {
final BackgroundPane backgroundPane = new BackgroundPane();
BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame());
backgroundPane.populate(FEditToolBar.this.background);
backgroundPane.populate(FormEditToolBar.this.background);
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
FEditToolBar.this.background = backgroundPane.update();
if (FEditToolBar.this.background != null) {
FEditToolBar.this.defaultCheckBox.setSelected(false);
FormEditToolBar.this.background = backgroundPane.update();
if (FormEditToolBar.this.background != null) {
FormEditToolBar.this.defaultCheckBox.setSelected(false);
}
}
});
@ -86,7 +86,7 @@ public class FEditToolBar extends BasicPane {
}
};
public FEditToolBar() {
public FormEditToolBar() {
initComponent();
}
@ -138,8 +138,8 @@ public class FEditToolBar extends BasicPane {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FToolBarButton) {
FToolBarButton button = (FToolBarButton) value;
if (value instanceof FormToolBarButton) {
FormToolBarButton button = (FormToolBarButton) value;
this.setText(button.getNameOption().optionName());
this.setIcon(button.getNameOption().optionIcon());
}
@ -152,11 +152,11 @@ public class FEditToolBar extends BasicPane {
return Inter.getLocText("FR-Designer_Edit");
}
public void populate(FToolBar ftoolbar) {
public void populate(FormToolBar ftoolbar) {
this.populate(ftoolbar, null);
}
public void populate(FToolBar ftoolbar, FToolBarButton button) {
public void populate(FormToolBar ftoolbar, FormToolBarButton button) {
if (ftoolbar == null) {
return;
}
@ -176,11 +176,11 @@ public class FEditToolBar extends BasicPane {
this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
}
public FToolBar update() {
public FormToolBar update() {
if (this.list.getSelectedIndex() > -1) {
for (int i = 0; i < listModel.getSize(); i++) {
this.list.setSelectedIndex(i);
FToolBarButton toolBarButton = (FToolBarButton) this.list.getSelectedValue();
FormToolBarButton toolBarButton = (FormToolBarButton) this.list.getSelectedValue();
Widget widget = this.bp.update();
toolBarButton.setWidget(widget);
if (widget instanceof Button) {
@ -192,11 +192,11 @@ public class FEditToolBar extends BasicPane {
}
}
}
java.util.List<FToolBarButton> list = new ArrayList<FToolBarButton>();
java.util.List<FormToolBarButton> list = new ArrayList<FormToolBarButton>();
for (int i = 0; i < listModel.size(); i++) {
list.add((FToolBarButton) listModel.get(i));
list.add((FormToolBarButton) listModel.get(i));
}
FToolBar ftoolBar = new FToolBar();
FormToolBar ftoolBar = new FormToolBar();
ftoolBar.setButtonlist(list);
ftoolBar.setDefault(this.defaultCheckBox.isSelected());
@ -284,10 +284,10 @@ public class FEditToolBar extends BasicPane {
*/
public void actionPerformed(ActionEvent e) {
int i = list.getSelectedIndex();
if (i < 0 || !(listModel.getElementAt(i) instanceof FToolBarButton)) {
if (i < 0 || !(listModel.getElementAt(i) instanceof FormToolBarButton)) {
return;
}
int val = JOptionPane.showConfirmDialog(FEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION);
int val = JOptionPane.showConfirmDialog(FormEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION);
if (val != JOptionPane.YES_OPTION) {
return;
}

8
designer_form/src/com/fr/design/mainframe/FSettingToolBar.java → designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java

@ -16,14 +16,14 @@ import java.awt.event.ActionListener;
/**
* Created by harry on 2017-3-2.
*/
public class FSettingToolBar extends JPanel {
public class FormSettingToolBar extends JPanel {
private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private UIButton setButton;
private UIButton delButton;
private FToolBarPane toolBarPane;
private FormToolBarPane toolBarPane;
public FSettingToolBar(String name,FToolBarPane toolBarPane) {
public FormSettingToolBar(String name, FormToolBarPane toolBarPane) {
super();
this.setBackground(Color.lightGray);
this.add(new UILabel(name));
@ -56,7 +56,7 @@ public class FSettingToolBar extends JPanel {
@Override
public void actionPerformed(ActionEvent arg0) {
final FEditToolBar tb = new FEditToolBar();
final FormEditToolBar tb = new FormEditToolBar();
tb.populate(toolBarPane.getFToolBar());
BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {

14
designer_form/src/com/fr/design/mainframe/FToolBar.java → designer_form/src/com/fr/design/mainframe/FormToolBar.java

@ -10,28 +10,28 @@ import java.util.List;
/**
* Created by harry on 2017-3-2.
*/
public class FToolBar {
private List<FToolBarButton> buttonlist = new ArrayList<FToolBarButton>();
public class FormToolBar {
private List<FormToolBarButton> buttonlist = new ArrayList<FormToolBarButton>();
private Background background = null;
private boolean isDefault = true;
public List<FToolBarButton> getButtonlist() {
public List<FormToolBarButton> getButtonlist() {
return buttonlist;
}
public void setButtonlist(List<FToolBarButton> buttonlist) {
public void setButtonlist(List<FormToolBarButton> buttonlist) {
if (buttonlist == null || buttonlist.size() < 0) {
this.buttonlist = new ArrayList<FToolBarButton>();
this.buttonlist = new ArrayList<FormToolBarButton>();
} else {
this.buttonlist = buttonlist;
}
}
public void addButton(FToolBarButton toolBarButton) {
public void addButton(FormToolBarButton toolBarButton) {
this.buttonlist.add(toolBarButton);
}
public void removeButton(FToolBarButton toolBarButton) {
public void removeButton(FormToolBarButton toolBarButton) {
this.buttonlist.remove(toolBarButton);
}

17
designer_form/src/com/fr/design/mainframe/FToolBarButton.java → designer_form/src/com/fr/design/mainframe/FormToolBarButton.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
@ -20,15 +19,15 @@ import java.awt.event.MouseListener;
/**
* Created by harry on 2017-3-2.
*/
public class FToolBarButton extends JButton implements MouseListener {
public class FormToolBarButton extends JButton implements MouseListener {
private Widget widget;
private WidgetOption no;
public FToolBarButton(Icon icon, Widget widget) {
public FormToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget);
}
public FToolBarButton(String text, Icon icon, Widget widget) {
public FormToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon);
init();
this.widget = widget;
@ -94,7 +93,7 @@ public class FToolBarButton extends JButton implements MouseListener {
paintBorder(g, this);
}
protected void paintBorder(Graphics g, FToolBarButton b) {
protected void paintBorder(Graphics g, FormToolBarButton b) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), true, Constants.NULL, b.isDoneAuthorityEdited(selectedRoles));
}
@ -110,9 +109,9 @@ public class FToolBarButton extends JButton implements MouseListener {
return;
}
if (e.getClickCount() >= 2) {
if (this.getParent() instanceof FToolBarPane) {
final FToolBarPane tb = (FToolBarPane) this.getParent();
final FEditToolBar etb = new FEditToolBar();
if (this.getParent() instanceof FormToolBarPane) {
final FormToolBarPane tb = (FormToolBarPane) this.getParent();
final FormEditToolBar etb = new FormEditToolBar();
etb.populate(tb.getFToolBar(), this);
BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {
@ -127,7 +126,7 @@ public class FToolBarButton extends JButton implements MouseListener {
private void auhtorityMouseAction() {
if (this.getParent() instanceof FToolBarPane && this.isEnabled()) {
if (this.getParent() instanceof FormToolBarPane && this.isEnabled()) {
this.setSelected(!this.isSelected());
}

42
designer_form/src/com/fr/design/mainframe/FToolBarPane.java → designer_form/src/com/fr/design/mainframe/FormToolBarPane.java

@ -20,11 +20,11 @@ import java.util.List;
/**
* Created by harry on 2017-3-2.
*/
public class FToolBarPane extends BasicBeanPane<ToolBar> {
public class FormToolBarPane extends BasicBeanPane<ToolBar> {
private FToolBar ftoolbar = new FToolBar();
private FormToolBar ftoolbar = new FormToolBar();
public FToolBarPane() {
public FormToolBarPane() {
super();
this.initComponent();
}
@ -36,13 +36,13 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
* @param mouselistener 鼠标监听
*/
public void addAuthorityListener(MouseListener mouselistener) {
List<FToolBarButton> list = ftoolbar.getButtonlist();
List<FormToolBarButton> list = ftoolbar.getButtonlist();
for (int i = 0; i < list.size(); i++) {
list.get(i).addMouseListener(mouselistener);
}
}
public FToolBarPane(FToolBarButton button) {
public FormToolBarPane(FormToolBarButton button) {
super();
this.initComponent();
this.add(button);
@ -70,7 +70,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
return "Toolbar";
}
public void setSelectedButton(FToolBarButton button) {
public void setSelectedButton(FormToolBarButton button) {
this.ftoolbar.addButton(button);
}
@ -82,8 +82,8 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
* @return 被添加的组件
*/
public Component add(Component comp) {
if (comp instanceof FToolBarButton) {
this.ftoolbar.addButton((FToolBarButton) comp);
if (comp instanceof FormToolBarButton) {
this.ftoolbar.addButton((FormToolBarButton) comp);
}
return super.add(comp);
}
@ -97,19 +97,19 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
this.ftoolbar.clearButton();
}
protected void setFToolBar(FToolBar ftoolbar) {
protected void setFToolBar(FormToolBar ftoolbar) {
if (ftoolbar == null) {
ftoolbar = new FToolBar();
ftoolbar = new FormToolBar();
}
this.ftoolbar = ftoolbar;
this.setToolBar(this.ftoolbar.getButtonlist());
}
public List<FToolBarButton> getToolBarButtons() {
public List<FormToolBarButton> getToolBarButtons() {
return ftoolbar.getButtonlist();
}
protected FToolBar getFToolBar() {
protected FormToolBar getFToolBar() {
return this.ftoolbar;
}
@ -117,7 +117,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
return this.ftoolbar.getButtonlist().size() <= 0;
}
private void setToolBar(List<FToolBarButton> list) {
private void setToolBar(List<FormToolBarButton> list) {
if (list == null || list.size() < 0) {
return;
}
@ -142,7 +142,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
continue;
}
FToolBarButton button = new FToolBarButton(no.optionIcon(), widget);
FormToolBarButton button = new FormToolBarButton(no.optionIcon(), widget);
button.setNameOption(no);
this.add(button);
this.validate();
@ -161,13 +161,13 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) {
final FEditToolBar tb = new FEditToolBar();
final FormEditToolBar tb = new FormEditToolBar();
tb.populate(getFToolBar());
BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FToolBarPane.this));
BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FormToolBarPane.this));
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
FToolBarPane.this.setFToolBar(tb.update());
FormToolBarPane.this.setFToolBar(tb.update());
}
});
dialog.setVisible(true);
@ -221,11 +221,11 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
}
Widget widget = data.createWidget();
FToolBarButton btn = new FToolBarButton(data.optionIcon(), widget);
FormToolBarButton btn = new FormToolBarButton(data.optionIcon(), widget);
btn.setNameOption(data);
FToolBarPane.this.add(btn);
FToolBarPane.this.validate();
FToolBarPane.this.repaint();
FormToolBarPane.this.add(btn);
FormToolBarPane.this.validate();
FormToolBarPane.this.repaint();
return true;
}

2
designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java

@ -18,7 +18,7 @@ public class FormWebWidgetConstants {
private FormWebWidgetConstants() {
}
public static WidgetOption[] getFormECToolBarInstance() {
public static WidgetOption[] getFormElementCaseToolBarInstance() {
return new WidgetOption[]{FIRST, PREVIOUS, PAGENAVI, NEXT, LAST, EXPORT, EXCELP, EXCELO, CUSTOM_BUTTON};
}

26
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java → designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java

@ -4,9 +4,9 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.FormWebWidgetConstants;
import com.fr.design.mainframe.widget.editors.ECToolBarPane;
import com.fr.design.mainframe.widget.wrappers.ECToolBarWrapper;
import com.fr.form.web.FToolBarManager;
import com.fr.design.mainframe.widget.editors.ElementCaseToolBarPane;
import com.fr.design.mainframe.widget.wrappers.ElementCaseToolBarWrapper;
import com.fr.form.web.FormToolBarManager;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
@ -17,17 +17,17 @@ import java.util.List;
/**
* Created by harry on 2017-2-23.
*/
public class AccessibleECToolBarEditor extends UneditableAccessibleEditor {
private ECToolBarPane pane;
public class AccessibleElementCaseToolBarEditor extends UneditableAccessibleEditor {
private ElementCaseToolBarPane pane;
public AccessibleECToolBarEditor() {
super(new ECToolBarWrapper());
public AccessibleElementCaseToolBarEditor() {
super(new ElementCaseToolBarWrapper());
}
@Override
protected void showEditorPane() {
if (pane == null) {
pane = new ECToolBarPane();
pane = new ElementCaseToolBarPane();
pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance());
}
BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() {
@ -38,18 +38,18 @@ public class AccessibleECToolBarEditor extends UneditableAccessibleEditor {
fireStateChanged();
}
});
FToolBarManager[] managers = (FToolBarManager[]) getValue();
FormToolBarManager[] managers = (FormToolBarManager[]) getValue();
pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers));
pane.populateBean((FToolBarManager[]) getValue());
pane.populateBean((FormToolBarManager[]) getValue());
dlg.setVisible(true);
}
private FToolBarManager getDefaultToolBarManager() {
return FToolBarManager.createDefaultToolBar();
private FormToolBarManager getDefaultToolBarManager() {
return FormToolBarManager.createDefaultToolBar();
}
private WidgetOption[] getToolBarInstance() {
List<WidgetOption> defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormECToolBarInstance());
List<WidgetOption> defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormElementCaseToolBarInstance());
List<WidgetOption> options = new ArrayList<WidgetOption>();
options.addAll(defaultOptions);
return options.toArray(new WidgetOption[options.size()]);

13
designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java

@ -1,13 +0,0 @@
package com.fr.design.mainframe.widget.editors;
import com.fr.design.mainframe.widget.accessibles.AccessibleECToolBarEditor;
import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor;
/**
* Created by harry on 2017-2-23.
*/
public class ECToolBarEditor extends AccessiblePropertyEditor {
public ECToolBarEditor() {
super(new AccessibleECToolBarEditor());
}
}

13
designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java

@ -0,0 +1,13 @@
package com.fr.design.mainframe.widget.editors;
import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor;
/**
* Created by harry on 2017-2-23.
*/
public class ElementCaseToolBarEditor extends AccessiblePropertyEditor {
public ElementCaseToolBarEditor() {
super(new AccessibleElementCaseToolBarEditor());
}
}

74
designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java → designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java

@ -8,12 +8,12 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FSettingToolBar;
import com.fr.design.mainframe.FToolBarButton;
import com.fr.design.mainframe.FToolBarPane;
import com.fr.design.mainframe.FormSettingToolBar;
import com.fr.design.mainframe.FormToolBarButton;
import com.fr.design.mainframe.FormToolBarPane;
import com.fr.form.ui.Widget;
import com.fr.form.web.FLocation;
import com.fr.form.web.FToolBarManager;
import com.fr.form.web.FormToolBarManager;
import com.fr.form.web.Location;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
@ -34,19 +34,19 @@ import java.util.List;
/**
* Created by harry on 2017-2-23.
*/
public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
public class ElementCaseToolBarPane extends BasicBeanPane<FormToolBarManager[]> {
private static final int COLUMN = 2;
private int row = 6;
private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable;
private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏
private FToolBarPane northToolBar;
private FToolBarPane southToolBar;
private FToolBarManager defaultToolBar;
private FormToolBarPane northToolBar;
private FormToolBarPane southToolBar;
private FormToolBarManager defaultToolBar;
public ECToolBarPane() {
public ElementCaseToolBarPane() {
toolbarButtonTableModel = new TableModel(row ,COLUMN);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -61,11 +61,11 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (defaultToolBar == null) {
return;
}
FToolBarManager toolBarManager = defaultToolBar;
toolBarManager.setToolBarLocation(FLocation.createTopEmbedLocation());
FToolBarManager[] tbm = new FToolBarManager[] { toolBarManager };
FormToolBarManager toolBarManager = defaultToolBar;
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
FormToolBarManager[] tbm = new FormToolBarManager[] { toolBarManager };
populateBean(tbm);
ECToolBarPane.this.repaint();
ElementCaseToolBarPane.this.repaint();
}
});
@ -75,7 +75,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
north.add(aa, BorderLayout.CENTER);
this.add(north, BorderLayout.NORTH);
northToolBar = new FToolBarPane();
northToolBar = new FormToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
northToolBar.setBackground(Color.lightGray);
@ -92,7 +92,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget);
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
@ -117,7 +117,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget);
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
southToolBar.add(tb);
southToolBar.validate();
@ -139,18 +139,18 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
small.add(layoutTable, BorderLayout.CENTER);
center.add(small, BorderLayout.CENTER);
center.add(downButton, BorderLayout.SOUTH);
southToolBar = new FToolBarPane();
southToolBar = new FormToolBarPane();
southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
southToolBar.setBackground(Color.lightGray);
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
FSettingToolBar top = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar);
FormSettingToolBar top = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar);
northContentPane.add(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER);
northContentPane.setBackground(Color.lightGray);
JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
FSettingToolBar bottom = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar);
FormSettingToolBar bottom = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar);
southContentPane.add(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER);
southContentPane.setBackground(Color.lightGray);
@ -180,7 +180,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget);
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
@ -207,7 +207,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
return this.isUseToolBarCheckBox.isSelected();
}
public void setDefaultToolBar(FToolBarManager defaultToolBar, WidgetOption[] buttonArray) {
public void setDefaultToolBar(FormToolBarManager defaultToolBar, WidgetOption[] buttonArray) {
this.defaultToolBar = defaultToolBar;
if (buttonArray != null) {
for (int i = 0; i < buttonArray.length; i++) {
@ -249,20 +249,20 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
}
@Override
public void populateBean(FToolBarManager[] toolBarManager) {
public void populateBean(FormToolBarManager[] toolBarManager) {
if (ArrayUtils.isEmpty(toolBarManager)) {
defaultToolBar.setToolBarLocation(FLocation.createTopEmbedLocation());
toolBarManager = new FToolBarManager[] { defaultToolBar };
defaultToolBar.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManager = new FormToolBarManager[] { defaultToolBar };
}
if (ArrayUtils.isEmpty(toolBarManager)) {
return;
}
for (int i = 0; i < toolBarManager.length; i++) {
FLocation location = toolBarManager[i].getToolBarLocation();
if (location instanceof FLocation.Embed) {
if (((FLocation.Embed)location).getPosition() == Constants.TOP) {
Location location = toolBarManager[i].getToolBarLocation();
if (location instanceof Location.Embed) {
if (((Location.Embed)location).getPosition() == Constants.TOP) {
northToolBar.populateBean(toolBarManager[i].getToolBar());
} else if (((FLocation.Embed)location).getPosition() == Constants.BOTTOM) {
} else if (((Location.Embed)location).getPosition() == Constants.BOTTOM) {
southToolBar.populateBean(toolBarManager[i].getToolBar());
}
}
@ -270,25 +270,25 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
}
@Override
public FToolBarManager[] updateBean() {
public FormToolBarManager[] updateBean() {
if(!isUseToolbar()){
return new FToolBarManager[0];
return new FormToolBarManager[0];
}
List<FToolBarManager> toolBarManagerList = new ArrayList<FToolBarManager>();
List<FormToolBarManager> toolBarManagerList = new ArrayList<FormToolBarManager>();
if (!northToolBar.isEmpty()) {
FToolBarManager north = new FToolBarManager();
FormToolBarManager north = new FormToolBarManager();
north.setToolBar(northToolBar.updateBean());
north.setToolBarLocation(FLocation.createTopEmbedLocation());
north.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManagerList.add(north);
}
if (!southToolBar.isEmpty()) {
FToolBarManager south = new FToolBarManager();
FormToolBarManager south = new FormToolBarManager();
south.setToolBar(southToolBar.updateBean());
south.setToolBarLocation(FLocation.createBottomEmbedLocation());
south.setToolBarLocation(Location.createBottomEmbedLocation());
toolBarManagerList.add(south);
}
return toolBarManagerList.toArray(new FToolBarManager[toolBarManagerList.size()]);
return toolBarManagerList.toArray(new FormToolBarManager[toolBarManagerList.size()]);
}
private class TableModel extends DefaultTableModel {

6
designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java → designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java

@ -3,13 +3,13 @@ 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.form.web.FToolBarManager;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.Inter;
/**
* Created by harry on 2017-3-1.
*/
public class ECToolBarWrapper implements Encoder, Decoder {
public class ElementCaseToolBarWrapper implements Encoder, Decoder {
@Override
public Object decode(String txt) {
return null;
@ -25,7 +25,7 @@ public class ECToolBarWrapper implements Encoder, Decoder {
if (v == null) {
return null;
}
FToolBarManager[] toolBarManager = (FToolBarManager[])v;
FormToolBarManager[] toolBarManager = (FormToolBarManager[])v;
if (toolBarManager.length != 0) {
return Inter.getLocText("FR-Designer_Open");
}
Loading…
Cancel
Save