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.fun.impl.AbstractFormElementCaseEditorProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.editors.ECToolBarEditor;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; 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.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider; import com.fr.form.FormElementCaseProvider;
import com.fr.form.FormProvider; 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) new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Layout_Padding")) .setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .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")) .setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .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. * Created by harry on 2017-3-2.
*/ */
public class FEditToolBar extends BasicPane { public class FormEditToolBar extends BasicPane {
private JList list; private JList list;
private DefaultListModel listModel; private DefaultListModel listModel;
private JPanel right; private JPanel right;
private CardLayout card; private CardLayout card;
private ButtonPane bp; private ButtonPane bp;
private FToolBarButton lastButton; private FormToolBarButton lastButton;
private Background background = null; private Background background = null;
private UICheckBox defaultCheckBox; private UICheckBox defaultCheckBox;
@ -52,8 +52,8 @@ public class FEditToolBar extends BasicPane {
if (lastButton != null) { if (lastButton != null) {
lastButton.setWidget(bp.update()); lastButton.setWidget(bp.update());
} }
if (list.getSelectedValue() instanceof FToolBarButton) { if (list.getSelectedValue() instanceof FormToolBarButton) {
lastButton = (FToolBarButton) list.getSelectedValue(); lastButton = (FormToolBarButton) list.getSelectedValue();
if (lastButton.getWidget() instanceof Button) { if (lastButton.getWidget() instanceof Button) {
card.show(right, "button"); card.show(right, "button");
bp.populate(lastButton.getWidget()); bp.populate(lastButton.getWidget());
@ -73,12 +73,12 @@ public class FEditToolBar extends BasicPane {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
final BackgroundPane backgroundPane = new BackgroundPane(); final BackgroundPane backgroundPane = new BackgroundPane();
BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame()); BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame());
backgroundPane.populate(FEditToolBar.this.background); backgroundPane.populate(FormEditToolBar.this.background);
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
FEditToolBar.this.background = backgroundPane.update(); FormEditToolBar.this.background = backgroundPane.update();
if (FEditToolBar.this.background != null) { if (FormEditToolBar.this.background != null) {
FEditToolBar.this.defaultCheckBox.setSelected(false); FormEditToolBar.this.defaultCheckBox.setSelected(false);
} }
} }
}); });
@ -86,7 +86,7 @@ public class FEditToolBar extends BasicPane {
} }
}; };
public FEditToolBar() { public FormEditToolBar() {
initComponent(); initComponent();
} }
@ -138,8 +138,8 @@ public class FEditToolBar extends BasicPane {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FToolBarButton) { if (value instanceof FormToolBarButton) {
FToolBarButton button = (FToolBarButton) value; FormToolBarButton button = (FormToolBarButton) value;
this.setText(button.getNameOption().optionName()); this.setText(button.getNameOption().optionName());
this.setIcon(button.getNameOption().optionIcon()); this.setIcon(button.getNameOption().optionIcon());
} }
@ -152,11 +152,11 @@ public class FEditToolBar extends BasicPane {
return Inter.getLocText("FR-Designer_Edit"); return Inter.getLocText("FR-Designer_Edit");
} }
public void populate(FToolBar ftoolbar) { public void populate(FormToolBar ftoolbar) {
this.populate(ftoolbar, null); this.populate(ftoolbar, null);
} }
public void populate(FToolBar ftoolbar, FToolBarButton button) { public void populate(FormToolBar ftoolbar, FormToolBarButton button) {
if (ftoolbar == null) { if (ftoolbar == null) {
return; return;
} }
@ -176,11 +176,11 @@ public class FEditToolBar extends BasicPane {
this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false); this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
} }
public FToolBar update() { public FormToolBar update() {
if (this.list.getSelectedIndex() > -1) { if (this.list.getSelectedIndex() > -1) {
for (int i = 0; i < listModel.getSize(); i++) { for (int i = 0; i < listModel.getSize(); i++) {
this.list.setSelectedIndex(i); this.list.setSelectedIndex(i);
FToolBarButton toolBarButton = (FToolBarButton) this.list.getSelectedValue(); FormToolBarButton toolBarButton = (FormToolBarButton) this.list.getSelectedValue();
Widget widget = this.bp.update(); Widget widget = this.bp.update();
toolBarButton.setWidget(widget); toolBarButton.setWidget(widget);
if (widget instanceof Button) { 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++) { 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.setButtonlist(list);
ftoolBar.setDefault(this.defaultCheckBox.isSelected()); ftoolBar.setDefault(this.defaultCheckBox.isSelected());
@ -284,10 +284,10 @@ public class FEditToolBar extends BasicPane {
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int i = list.getSelectedIndex(); int i = list.getSelectedIndex();
if (i < 0 || !(listModel.getElementAt(i) instanceof FToolBarButton)) { if (i < 0 || !(listModel.getElementAt(i) instanceof FormToolBarButton)) {
return; 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) { if (val != JOptionPane.YES_OPTION) {
return; 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. * 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 setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private UIButton setButton; private UIButton setButton;
private UIButton delButton; private UIButton delButton;
private FToolBarPane toolBarPane; private FormToolBarPane toolBarPane;
public FSettingToolBar(String name,FToolBarPane toolBarPane) { public FormSettingToolBar(String name, FormToolBarPane toolBarPane) {
super(); super();
this.setBackground(Color.lightGray); this.setBackground(Color.lightGray);
this.add(new UILabel(name)); this.add(new UILabel(name));
@ -56,7 +56,7 @@ public class FSettingToolBar extends JPanel {
@Override @Override
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
final FEditToolBar tb = new FEditToolBar(); final FormEditToolBar tb = new FormEditToolBar();
tb.populate(toolBarPane.getFToolBar()); tb.populate(toolBarPane.getFToolBar());
BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame()); BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() { 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. * Created by harry on 2017-3-2.
*/ */
public class FToolBar { public class FormToolBar {
private List<FToolBarButton> buttonlist = new ArrayList<FToolBarButton>(); private List<FormToolBarButton> buttonlist = new ArrayList<FormToolBarButton>();
private Background background = null; private Background background = null;
private boolean isDefault = true; private boolean isDefault = true;
public List<FToolBarButton> getButtonlist() { public List<FormToolBarButton> getButtonlist() {
return buttonlist; return buttonlist;
} }
public void setButtonlist(List<FToolBarButton> buttonlist) { public void setButtonlist(List<FormToolBarButton> buttonlist) {
if (buttonlist == null || buttonlist.size() < 0) { if (buttonlist == null || buttonlist.size() < 0) {
this.buttonlist = new ArrayList<FToolBarButton>(); this.buttonlist = new ArrayList<FormToolBarButton>();
} else { } else {
this.buttonlist = buttonlist; this.buttonlist = buttonlist;
} }
} }
public void addButton(FToolBarButton toolBarButton) { public void addButton(FormToolBarButton toolBarButton) {
this.buttonlist.add(toolBarButton); this.buttonlist.add(toolBarButton);
} }
public void removeButton(FToolBarButton toolBarButton) { public void removeButton(FormToolBarButton toolBarButton) {
this.buttonlist.remove(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; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
@ -20,15 +19,15 @@ import java.awt.event.MouseListener;
/** /**
* Created by harry on 2017-3-2. * 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 Widget widget;
private WidgetOption no; private WidgetOption no;
public FToolBarButton(Icon icon, Widget widget) { public FormToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget); this(null, icon, widget);
} }
public FToolBarButton(String text, Icon icon, Widget widget) { public FormToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon); super(text, icon);
init(); init();
this.widget = widget; this.widget = widget;
@ -94,7 +93,7 @@ public class FToolBarButton extends JButton implements MouseListener {
paintBorder(g, this); paintBorder(g, this);
} }
protected void paintBorder(Graphics g, FToolBarButton b) { protected void paintBorder(Graphics g, FormToolBarButton b) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), true, Constants.NULL, b.isDoneAuthorityEdited(selectedRoles)); 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; return;
} }
if (e.getClickCount() >= 2) { if (e.getClickCount() >= 2) {
if (this.getParent() instanceof FToolBarPane) { if (this.getParent() instanceof FormToolBarPane) {
final FToolBarPane tb = (FToolBarPane) this.getParent(); final FormToolBarPane tb = (FormToolBarPane) this.getParent();
final FEditToolBar etb = new FEditToolBar(); final FormEditToolBar etb = new FormEditToolBar();
etb.populate(tb.getFToolBar(), this); etb.populate(tb.getFToolBar(), this);
BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@ -127,7 +126,7 @@ public class FToolBarButton extends JButton implements MouseListener {
private void auhtorityMouseAction() { private void auhtorityMouseAction() {
if (this.getParent() instanceof FToolBarPane && this.isEnabled()) { if (this.getParent() instanceof FormToolBarPane && this.isEnabled()) {
this.setSelected(!this.isSelected()); 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. * 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(); super();
this.initComponent(); this.initComponent();
} }
@ -36,13 +36,13 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
* @param mouselistener 鼠标监听 * @param mouselistener 鼠标监听
*/ */
public void addAuthorityListener(MouseListener mouselistener) { public void addAuthorityListener(MouseListener mouselistener) {
List<FToolBarButton> list = ftoolbar.getButtonlist(); List<FormToolBarButton> list = ftoolbar.getButtonlist();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
list.get(i).addMouseListener(mouselistener); list.get(i).addMouseListener(mouselistener);
} }
} }
public FToolBarPane(FToolBarButton button) { public FormToolBarPane(FormToolBarButton button) {
super(); super();
this.initComponent(); this.initComponent();
this.add(button); this.add(button);
@ -70,7 +70,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
return "Toolbar"; return "Toolbar";
} }
public void setSelectedButton(FToolBarButton button) { public void setSelectedButton(FormToolBarButton button) {
this.ftoolbar.addButton(button); this.ftoolbar.addButton(button);
} }
@ -82,8 +82,8 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
* @return 被添加的组件 * @return 被添加的组件
*/ */
public Component add(Component comp) { public Component add(Component comp) {
if (comp instanceof FToolBarButton) { if (comp instanceof FormToolBarButton) {
this.ftoolbar.addButton((FToolBarButton) comp); this.ftoolbar.addButton((FormToolBarButton) comp);
} }
return super.add(comp); return super.add(comp);
} }
@ -97,19 +97,19 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
this.ftoolbar.clearButton(); this.ftoolbar.clearButton();
} }
protected void setFToolBar(FToolBar ftoolbar) { protected void setFToolBar(FormToolBar ftoolbar) {
if (ftoolbar == null) { if (ftoolbar == null) {
ftoolbar = new FToolBar(); ftoolbar = new FormToolBar();
} }
this.ftoolbar = ftoolbar; this.ftoolbar = ftoolbar;
this.setToolBar(this.ftoolbar.getButtonlist()); this.setToolBar(this.ftoolbar.getButtonlist());
} }
public List<FToolBarButton> getToolBarButtons() { public List<FormToolBarButton> getToolBarButtons() {
return ftoolbar.getButtonlist(); return ftoolbar.getButtonlist();
} }
protected FToolBar getFToolBar() { protected FormToolBar getFToolBar() {
return this.ftoolbar; return this.ftoolbar;
} }
@ -117,7 +117,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
return this.ftoolbar.getButtonlist().size() <= 0; return this.ftoolbar.getButtonlist().size() <= 0;
} }
private void setToolBar(List<FToolBarButton> list) { private void setToolBar(List<FormToolBarButton> list) {
if (list == null || list.size() < 0) { if (list == null || list.size() < 0) {
return; return;
} }
@ -142,7 +142,7 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
continue; continue;
} }
FToolBarButton button = new FToolBarButton(no.optionIcon(), widget); FormToolBarButton button = new FormToolBarButton(no.optionIcon(), widget);
button.setNameOption(no); button.setNameOption(no);
this.add(button); this.add(button);
this.validate(); this.validate();
@ -161,13 +161,13 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) { if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) {
final FEditToolBar tb = new FEditToolBar(); final FormEditToolBar tb = new FormEditToolBar();
tb.populate(getFToolBar()); tb.populate(getFToolBar());
BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FToolBarPane.this)); BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FormToolBarPane.this));
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
FToolBarPane.this.setFToolBar(tb.update()); FormToolBarPane.this.setFToolBar(tb.update());
} }
}); });
dialog.setVisible(true); dialog.setVisible(true);
@ -221,11 +221,11 @@ public class FToolBarPane extends BasicBeanPane<ToolBar> {
} }
Widget widget = data.createWidget(); Widget widget = data.createWidget();
FToolBarButton btn = new FToolBarButton(data.optionIcon(), widget); FormToolBarButton btn = new FormToolBarButton(data.optionIcon(), widget);
btn.setNameOption(data); btn.setNameOption(data);
FToolBarPane.this.add(btn); FormToolBarPane.this.add(btn);
FToolBarPane.this.validate(); FormToolBarPane.this.validate();
FToolBarPane.this.repaint(); FormToolBarPane.this.repaint();
return true; return true;
} }

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

@ -18,7 +18,7 @@ public class FormWebWidgetConstants {
private FormWebWidgetConstants() { private FormWebWidgetConstants() {
} }
public static WidgetOption[] getFormECToolBarInstance() { public static WidgetOption[] getFormElementCaseToolBarInstance() {
return new WidgetOption[]{FIRST, PREVIOUS, PAGENAVI, NEXT, LAST, EXPORT, EXCELP, EXCELO, CUSTOM_BUTTON}; 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.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.FormWebWidgetConstants; import com.fr.design.mainframe.FormWebWidgetConstants;
import com.fr.design.mainframe.widget.editors.ECToolBarPane; import com.fr.design.mainframe.widget.editors.ElementCaseToolBarPane;
import com.fr.design.mainframe.widget.wrappers.ECToolBarWrapper; import com.fr.design.mainframe.widget.wrappers.ElementCaseToolBarWrapper;
import com.fr.form.web.FToolBarManager; import com.fr.form.web.FormToolBarManager;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
@ -17,17 +17,17 @@ import java.util.List;
/** /**
* Created by harry on 2017-2-23. * Created by harry on 2017-2-23.
*/ */
public class AccessibleECToolBarEditor extends UneditableAccessibleEditor { public class AccessibleElementCaseToolBarEditor extends UneditableAccessibleEditor {
private ECToolBarPane pane; private ElementCaseToolBarPane pane;
public AccessibleECToolBarEditor() { public AccessibleElementCaseToolBarEditor() {
super(new ECToolBarWrapper()); super(new ElementCaseToolBarWrapper());
} }
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (pane == null) { if (pane == null) {
pane = new ECToolBarPane(); pane = new ElementCaseToolBarPane();
pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance()); pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance());
} }
BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() {
@ -38,18 +38,18 @@ public class AccessibleECToolBarEditor extends UneditableAccessibleEditor {
fireStateChanged(); fireStateChanged();
} }
}); });
FToolBarManager[] managers = (FToolBarManager[]) getValue(); FormToolBarManager[] managers = (FormToolBarManager[]) getValue();
pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers)); pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers));
pane.populateBean((FToolBarManager[]) getValue()); pane.populateBean((FormToolBarManager[]) getValue());
dlg.setVisible(true); dlg.setVisible(true);
} }
private FToolBarManager getDefaultToolBarManager() { private FormToolBarManager getDefaultToolBarManager() {
return FToolBarManager.createDefaultToolBar(); return FormToolBarManager.createDefaultToolBar();
} }
private WidgetOption[] getToolBarInstance() { private WidgetOption[] getToolBarInstance() {
List<WidgetOption> defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormECToolBarInstance()); List<WidgetOption> defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormElementCaseToolBarInstance());
List<WidgetOption> options = new ArrayList<WidgetOption>(); List<WidgetOption> options = new ArrayList<WidgetOption>();
options.addAll(defaultOptions); options.addAll(defaultOptions);
return options.toArray(new WidgetOption[options.size()]); 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.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FSettingToolBar; import com.fr.design.mainframe.FormSettingToolBar;
import com.fr.design.mainframe.FToolBarButton; import com.fr.design.mainframe.FormToolBarButton;
import com.fr.design.mainframe.FToolBarPane; import com.fr.design.mainframe.FormToolBarPane;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.web.FLocation; import com.fr.form.web.FormToolBarManager;
import com.fr.form.web.FToolBarManager; import com.fr.form.web.Location;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -34,19 +34,19 @@ import java.util.List;
/** /**
* Created by harry on 2017-2-23. * 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 static final int COLUMN = 2;
private int row = 6; private int row = 6;
private DefaultTableModel toolbarButtonTableModel; private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable; private JTable layoutTable;
private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏 private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏
private FToolBarPane northToolBar; private FormToolBarPane northToolBar;
private FToolBarPane southToolBar; private FormToolBarPane southToolBar;
private FToolBarManager defaultToolBar; private FormToolBarManager defaultToolBar;
public ECToolBarPane() { public ElementCaseToolBarPane() {
toolbarButtonTableModel = new TableModel(row ,COLUMN); toolbarButtonTableModel = new TableModel(row ,COLUMN);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -61,11 +61,11 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (defaultToolBar == null) { if (defaultToolBar == null) {
return; return;
} }
FToolBarManager toolBarManager = defaultToolBar; FormToolBarManager toolBarManager = defaultToolBar;
toolBarManager.setToolBarLocation(FLocation.createTopEmbedLocation()); toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
FToolBarManager[] tbm = new FToolBarManager[] { toolBarManager }; FormToolBarManager[] tbm = new FormToolBarManager[] { toolBarManager };
populateBean(tbm); populateBean(tbm);
ECToolBarPane.this.repaint(); ElementCaseToolBarPane.this.repaint();
} }
}); });
@ -75,7 +75,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
north.add(aa, BorderLayout.CENTER); north.add(aa, BorderLayout.CENTER);
this.add(north, BorderLayout.NORTH); this.add(north, BorderLayout.NORTH);
northToolBar = new FToolBarPane(); northToolBar = new FormToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
northToolBar.setBackground(Color.lightGray); northToolBar.setBackground(Color.lightGray);
@ -92,7 +92,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (isSelectedtable()) { if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget(); Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no); tb.setNameOption(no);
northToolBar.add(tb); northToolBar.add(tb);
northToolBar.validate(); northToolBar.validate();
@ -117,7 +117,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (isSelectedtable()) { if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget(); Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no); tb.setNameOption(no);
southToolBar.add(tb); southToolBar.add(tb);
southToolBar.validate(); southToolBar.validate();
@ -139,18 +139,18 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
small.add(layoutTable, BorderLayout.CENTER); small.add(layoutTable, BorderLayout.CENTER);
center.add(small, BorderLayout.CENTER); center.add(small, BorderLayout.CENTER);
center.add(downButton, BorderLayout.SOUTH); center.add(downButton, BorderLayout.SOUTH);
southToolBar = new FToolBarPane(); southToolBar = new FormToolBarPane();
southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
southToolBar.setBackground(Color.lightGray); southToolBar.setBackground(Color.lightGray);
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northContentPane = 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(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER); northContentPane.add(northToolBar, BorderLayout.CENTER);
northContentPane.setBackground(Color.lightGray); northContentPane.setBackground(Color.lightGray);
JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); 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(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER); southContentPane.add(southToolBar, BorderLayout.CENTER);
southContentPane.setBackground(Color.lightGray); southContentPane.setBackground(Color.lightGray);
@ -180,7 +180,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) { if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget(); Widget widget = no.createWidget();
FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no); tb.setNameOption(no);
northToolBar.add(tb); northToolBar.add(tb);
northToolBar.validate(); northToolBar.validate();
@ -207,7 +207,7 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
return this.isUseToolBarCheckBox.isSelected(); return this.isUseToolBarCheckBox.isSelected();
} }
public void setDefaultToolBar(FToolBarManager defaultToolBar, WidgetOption[] buttonArray) { public void setDefaultToolBar(FormToolBarManager defaultToolBar, WidgetOption[] buttonArray) {
this.defaultToolBar = defaultToolBar; this.defaultToolBar = defaultToolBar;
if (buttonArray != null) { if (buttonArray != null) {
for (int i = 0; i < buttonArray.length; i++) { for (int i = 0; i < buttonArray.length; i++) {
@ -249,20 +249,20 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
} }
@Override @Override
public void populateBean(FToolBarManager[] toolBarManager) { public void populateBean(FormToolBarManager[] toolBarManager) {
if (ArrayUtils.isEmpty(toolBarManager)) { if (ArrayUtils.isEmpty(toolBarManager)) {
defaultToolBar.setToolBarLocation(FLocation.createTopEmbedLocation()); defaultToolBar.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManager = new FToolBarManager[] { defaultToolBar }; toolBarManager = new FormToolBarManager[] { defaultToolBar };
} }
if (ArrayUtils.isEmpty(toolBarManager)) { if (ArrayUtils.isEmpty(toolBarManager)) {
return; return;
} }
for (int i = 0; i < toolBarManager.length; i++) { for (int i = 0; i < toolBarManager.length; i++) {
FLocation location = toolBarManager[i].getToolBarLocation(); Location location = toolBarManager[i].getToolBarLocation();
if (location instanceof FLocation.Embed) { if (location instanceof Location.Embed) {
if (((FLocation.Embed)location).getPosition() == Constants.TOP) { if (((Location.Embed)location).getPosition() == Constants.TOP) {
northToolBar.populateBean(toolBarManager[i].getToolBar()); 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()); southToolBar.populateBean(toolBarManager[i].getToolBar());
} }
} }
@ -270,25 +270,25 @@ public class ECToolBarPane extends BasicBeanPane<FToolBarManager[]> {
} }
@Override @Override
public FToolBarManager[] updateBean() { public FormToolBarManager[] updateBean() {
if(!isUseToolbar()){ 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()) { if (!northToolBar.isEmpty()) {
FToolBarManager north = new FToolBarManager(); FormToolBarManager north = new FormToolBarManager();
north.setToolBar(northToolBar.updateBean()); north.setToolBar(northToolBar.updateBean());
north.setToolBarLocation(FLocation.createTopEmbedLocation()); north.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManagerList.add(north); toolBarManagerList.add(north);
} }
if (!southToolBar.isEmpty()) { if (!southToolBar.isEmpty()) {
FToolBarManager south = new FToolBarManager(); FormToolBarManager south = new FormToolBarManager();
south.setToolBar(southToolBar.updateBean()); south.setToolBar(southToolBar.updateBean());
south.setToolBarLocation(FLocation.createBottomEmbedLocation()); south.setToolBarLocation(Location.createBottomEmbedLocation());
toolBarManagerList.add(south); toolBarManagerList.add(south);
} }
return toolBarManagerList.toArray(new FToolBarManager[toolBarManagerList.size()]); return toolBarManagerList.toArray(new FormToolBarManager[toolBarManagerList.size()]);
} }
private class TableModel extends DefaultTableModel { 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.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;
import com.fr.form.web.FToolBarManager; import com.fr.form.web.FormToolBarManager;
import com.fr.general.Inter; import com.fr.general.Inter;
/** /**
* Created by harry on 2017-3-1. * Created by harry on 2017-3-1.
*/ */
public class ECToolBarWrapper implements Encoder, Decoder { public class ElementCaseToolBarWrapper implements Encoder, Decoder {
@Override @Override
public Object decode(String txt) { public Object decode(String txt) {
return null; return null;
@ -25,7 +25,7 @@ public class ECToolBarWrapper implements Encoder, Decoder {
if (v == null) { if (v == null) {
return null; return null;
} }
FToolBarManager[] toolBarManager = (FToolBarManager[])v; FormToolBarManager[] toolBarManager = (FormToolBarManager[])v;
if (toolBarManager.length != 0) { if (toolBarManager.length != 0) {
return Inter.getLocText("FR-Designer_Open"); return Inter.getLocText("FR-Designer_Open");
} }
Loading…
Cancel
Save