diff --git a/designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java b/designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java
index 6f235307e1..15a0b07d18 100644
--- a/designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java
+++ b/designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java
@@ -39,7 +39,7 @@ public class EditFloatElementNameAction extends FloatSelectionAction {
if (report.getFloatElement(name) == null) {
selectedFloatElement.setName(name);
}
- reportPane.setSelection(new FloatSelection(name));
+ ((FloatSelection) reportPane.getSelection()).setFloatName(name);
}
});
nameDialog.setVisible(true);
diff --git a/designer/src/com/fr/design/actions/package.html b/designer/src/com/fr/design/actions/package.html
new file mode 100644
index 0000000000..b3f9a9493e
--- /dev/null
+++ b/designer/src/com/fr/design/actions/package.html
@@ -0,0 +1,5 @@
+
+
+定义了响应各种事件的 Action
+
+
\ No newline at end of file
diff --git a/designer/src/com/fr/design/cell/editor/package.html b/designer/src/com/fr/design/cell/editor/package.html
index 181bdb68cf..f44232f536 100644
--- a/designer/src/com/fr/design/cell/editor/package.html
+++ b/designer/src/com/fr/design/cell/editor/package.html
@@ -1,13 +1,9 @@
-
-
+文本单元格编辑器({@link com.fr.cell.editor.GeneralCellEditor GeneralCellEditor})类.
\ No newline at end of file
diff --git a/designer/src/com/fr/design/condition/package.html b/designer/src/com/fr/design/condition/package.html
new file mode 100644
index 0000000000..7ad30f8025
--- /dev/null
+++ b/designer/src/com/fr/design/condition/package.html
@@ -0,0 +1,5 @@
+
+
+条件属性悬浮编辑框中的相关面板
+
+
\ No newline at end of file
diff --git a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java b/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
index bb52b766c3..62538e7d05 100644
--- a/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
+++ b/designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
@@ -37,6 +37,8 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import java.util.regex.Pattern;
/**
@@ -57,6 +59,7 @@ public class SelectedDataColumnPane extends BasicPane {
private UIButton paramButton;
private ElementCasePane casePane;
+ private CellElement cellElement; // 保存当前选中的 CE
public SelectedDataColumnPane() {
this(true, false, null);
@@ -159,6 +162,7 @@ public class SelectedDataColumnPane extends BasicPane {
if (cellElement == null) {
return;
}
+ this.cellElement = cellElement;
if (itemListener != null) {
removeListener(itemListener);
}
@@ -259,10 +263,20 @@ public class SelectedDataColumnPane extends BasicPane {
protected void initTableNameComboBox() {
tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
+ final ExecutorService executorService = Executors.newSingleThreadExecutor();
tableNameComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
- columnNameComboBox.setLoaded(false);
+ if (e.getStateChange() == ItemEvent.SELECTED) {
+ executorService.execute(new Runnable() {
+ @Override
+ public void run() {
+ synchronized (columnNameComboBox) {
+ columnNameComboBox.loadInstant();
+ }
+ }
+ });
+ }
}
});
tableNameComboBox.setPreferredSize(new Dimension(100, 20));
@@ -303,7 +317,7 @@ public class SelectedDataColumnPane extends BasicPane {
public void doOk() {
List parameterList = editorPane.update();
ps = parameterList.toArray(new Parameter[parameterList.size()]);
- update(cellElement);
+ update(SelectedDataColumnPane.this.cellElement);
casePane.fireTargetModified();
}
});
diff --git a/designer/src/com/fr/design/dscolumn/package.html b/designer/src/com/fr/design/dscolumn/package.html
new file mode 100644
index 0000000000..7c3869f2a7
--- /dev/null
+++ b/designer/src/com/fr/design/dscolumn/package.html
@@ -0,0 +1,5 @@
+
+
+数据列相关面板
+
+
\ No newline at end of file
diff --git a/designer/src/com/fr/design/expand/package.html b/designer/src/com/fr/design/expand/package.html
new file mode 100644
index 0000000000..038eb5319c
--- /dev/null
+++ b/designer/src/com/fr/design/expand/package.html
@@ -0,0 +1,5 @@
+
+
+"单元格属性"->"扩展"的界面
+
+
\ No newline at end of file
diff --git a/designer/src/com/fr/design/mainframe/ElementCasePane.java b/designer/src/com/fr/design/mainframe/ElementCasePane.java
index 46c363c380..547fdcf480 100644
--- a/designer/src/com/fr/design/mainframe/ElementCasePane.java
+++ b/designer/src/com/fr/design/mainframe/ElementCasePane.java
@@ -522,15 +522,15 @@ public abstract class ElementCasePane extends Tar
* 因为这边判断selection是一个selection,所以不会触发fireSelectionChanged
*/
public void setSelection(Selection selection) {
- try {
- //旧选中内容编辑器释放模板对象
- this.getCurrentEditor().release();
- } catch (UnsupportedOperationException e) {
- FRLogger.getLogger().info("Nothing to release");
- }
if (!ComparatorUtils.equals(this.selection, selection) ||
!ComparatorUtils.equals(EastRegionContainerPane.getInstance().getCellAttrPane(), CellElementPropertyPane.getInstance())) {
+ try {
+ //旧选中内容编辑器释放模板对象
+ this.getCurrentEditor().release();
+ } catch (UnsupportedOperationException e) {
+ FRLogger.getLogger().info("Nothing to release");
+ }
this.selection = selection;
fireSelectionChanged();
}
diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
index 8d25463ab8..cc57b7a852 100644
--- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
+++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
@@ -75,9 +75,7 @@ public class ElementCasePaneDelegate extends ElementCasePane {
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return;
}
- if (DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
- CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
- }
+ CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
diff --git a/designer/src/com/fr/design/report/package.html b/designer/src/com/fr/design/report/package.html
new file mode 100644
index 0000000000..c956ed1f36
--- /dev/null
+++ b/designer/src/com/fr/design/report/package.html
@@ -0,0 +1,5 @@
+
+
+包含制作模版过程中可能用到的各种面板(如页面设置、富文本编辑、Excel导出、移动端自适应等)
+
+
\ No newline at end of file
diff --git a/designer/src/com/fr/design/webattr/EditToolBar.java b/designer/src/com/fr/design/webattr/EditToolBar.java
index 938fd4509b..a8ebd932fc 100644
--- a/designer/src/com/fr/design/webattr/EditToolBar.java
+++ b/designer/src/com/fr/design/webattr/EditToolBar.java
@@ -34,13 +34,12 @@ import com.fr.report.web.button.Export;
import com.fr.report.web.button.PDFPrint;
import com.fr.report.web.button.Print;
import com.fr.report.web.button.write.AppendColumnRow;
+import com.fr.report.web.button.write.ExcelImport;
import com.fr.report.web.button.write.Submit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
@@ -52,488 +51,512 @@ import java.util.Set;
public class EditToolBar extends BasicPane {
- private JWorkBook jwb;
- private JList list;
- private DefaultListModel listModel;
- private JPanel right;
- private CardLayout card;
- private ButtonPane bp;
- private ToolBarButton lastButton;
- private Background background = null;
- private UICheckBox defaultCheckBox;
-
- private ListSelectionListener listSelectionListener = new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent evt) {
- if (lastButton != null) {
- lastButton.setWidget(bp.update());
- }
- if (list.getSelectedValue() instanceof ToolBarButton) {
- lastButton = (ToolBarButton) list.getSelectedValue();
- if (lastButton.getWidget() instanceof Button) {
- card.show(right, "button");
- bp.populate(lastButton.getWidget());
- } else {
- bp.populate(lastButton.getWidget());
- card.show(right, "none");
- }
- }
- }
- };
-
-
- private ActionListener actioner = new ActionListener() {
- /**
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- final BackgroundPane backgroundPane = new BackgroundPane();
- BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame());
- backgroundPane.populate(EditToolBar.this.background);
- dialog.addDialogActionListener(new DialogActionAdapter() {
- public void doOk() {
- EditToolBar.this.background = backgroundPane.update();
- if (EditToolBar.this.background != null) {
- EditToolBar.this.defaultCheckBox.setSelected(false);
- }
- }
- });
- dialog.setVisible(true);
- }
- };
-
- public EditToolBar() {
- initComponent();
- }
-
- /**
- * 初始化
- */
- public void initComponent() {
- this.setLayout(FRGUIPaneFactory.createBorderLayout());
- JPanel left = FRGUIPaneFactory.createBorderLayout_S_Pane();
- listModel = new DefaultListModel();
- list = new JList(listModel);
- list.setCellRenderer(render);
- left.add(new JScrollPane(list), BorderLayout.CENTER);
- if (listModel.getSize() > 0) {
- list.setSelectedIndex(0);
- }
-
- ToolBarDef toolbarDef = new ToolBarDef();
- toolbarDef.addShortCut(new MoveUpItemAction());
- toolbarDef.addShortCut(new MoveDownItemAction());
- toolbarDef.addShortCut(new RemoveAction());
- UIToolbar toolBar = ToolBarDef.createJToolBar();
- toolbarDef.updateToolBar(toolBar);
- left.add(toolBar, BorderLayout.NORTH);
-
- right = FRGUIPaneFactory.createCardLayout_S_Pane();
- card = new CardLayout();
- right.setLayout(card);
- bp = new ButtonPane();
- right.add("none", FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane());
- right.add("button", bp);
-
- JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right);
- // splitPane.setDividerLocation(left.getMinimumSize().width);
- splitPane.setDividerLocation(120);
- this.add(splitPane);
- list.addListSelectionListener(listSelectionListener);
- JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
- UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"}));
- defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"}));
- bgButton.addActionListener(actioner);
- backgroundPane.add(defaultCheckBox);
- backgroundPane.add(bgButton);
- backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"})));
- this.add(backgroundPane, BorderLayout.SOUTH);
- }
-
- ListCellRenderer render = new DefaultListCellRenderer() {
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-
- if (value instanceof ToolBarButton) {
- ToolBarButton button = (ToolBarButton) value;
- this.setText(button.getNameOption().optionName());
- this.setIcon(button.getNameOption().optionIcon());
- }
- return this;
- }
- };
-
- @Override
- protected String title4PopupWindow() {
- return Inter.getLocText("FR-Designer_Edit");
- }
-
- public void populate(FToolBar ftoolbar) {
- this.populate(ftoolbar, null);
- }
-
- public void populate(FToolBar ftoolbar, ToolBarButton button) {
- if (ftoolbar == null) {
- return;
- }
- for (int i = 0; i < ftoolbar.getButtonlist().size(); i++) {
- listModel.addElement(ftoolbar.getButtonlist().get(i));
- }
- this.list.validate();
- this.list.repaint();
- if (ftoolbar.getButtonlist().size() > 0) {
- this.list.setSelectedIndex(0);
- }
- if (button != null) {
- this.list.setSelectedValue(button, true);
- }
- this.background = ftoolbar.getBackground();
-
- this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
- }
-
- public FToolBar update() {
- if (this.list.getSelectedIndex() > -1) {
- for (int i = 0; i < listModel.getSize(); i++) {
- this.list.setSelectedIndex(i);
- ToolBarButton toolBarButton = (ToolBarButton) this.list.getSelectedValue();
- Widget widget = this.bp.update();
- toolBarButton.setWidget(widget);
- if (widget instanceof Button) {
- String iconname = ((Button) widget).getIconName();
- if (StringUtils.isNotBlank(iconname)) {
- Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname);
- toolBarButton.setIcon(new ImageIcon(iimage));
- }
- }
- }
- }
- List list = new ArrayList();
- for (int i = 0; i < listModel.size(); i++) {
- list.add((ToolBarButton) listModel.get(i));
- }
- FToolBar ftoolBar = new FToolBar();
- ftoolBar.setButtonlist(list);
-
- ftoolBar.setDefault(this.defaultCheckBox.isSelected());
- if (!ftoolBar.isDefault()) {
- ftoolBar.setBackground(this.background);
- }
- return ftoolBar;
- }
-
- private class MoveUpItemAction extends UpdateAction {
- public MoveUpItemAction() {
- this.setName(Inter.getLocText("Utils-Move_Up"));
- this.setMnemonic('U');
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
- }
-
- /**
- *
- */
- public void actionPerformed(ActionEvent evt) {
- int selectedIndex = list.getSelectedIndex();
- if (selectedIndex == -1) {
- return;
- }
-
- // 上移
- if (selectedIndex > 0) {
- DefaultListModel listModel = (DefaultListModel) list.getModel();
-
- Object selecteObj1 = listModel.get(selectedIndex - 1);
- listModel.set(selectedIndex - 1, listModel.get(selectedIndex));
- listModel.set(selectedIndex, selecteObj1);
-
- list.setSelectedIndex(selectedIndex - 1);
- list.ensureIndexIsVisible(selectedIndex - 1);
- list.validate();
- }
- }
- }
-
- private class MoveDownItemAction extends UpdateAction {
- public MoveDownItemAction() {
- this.setName(Inter.getLocText("Utils-Move_Down"));
- this.setMnemonic('D');
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
- }
-
- /**
- *
- */
- public void actionPerformed(ActionEvent evt) {
- int selectedIndex = list.getSelectedIndex();
- if (selectedIndex == -1) {
- return;
- }
-
- // 下移
- if (selectedIndex == -1) {
- return;
- }
-
- if (selectedIndex < list.getModel().getSize() - 1) {
- DefaultListModel listModel = (DefaultListModel) list.getModel();
-
- Object selecteObj1 = listModel.get(selectedIndex + 1);
- listModel.set(selectedIndex + 1, listModel.get(selectedIndex));
- listModel.set(selectedIndex, selecteObj1);
-
- list.setSelectedIndex(selectedIndex + 1);
- list.ensureIndexIsVisible(selectedIndex + 1);
- list.validate();
- }
- }
- }
-
- public class RemoveAction extends UpdateAction {
- public RemoveAction() {
- this.setName(Inter.getLocText("FR-Designer_Delete"));
- this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
- }
-
- /**
- * 动作
- * @param e 事件
- */
- public void actionPerformed(ActionEvent e) {
- int i = list.getSelectedIndex();
- if (i < 0 || !(listModel.getElementAt(i) instanceof ToolBarButton)) {
- return;
- }
- int val = JOptionPane.showConfirmDialog(EditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION);
- if (val != JOptionPane.YES_OPTION) {
- return;
- }
- listModel.removeElementAt(i);
- list.validate();
- if (listModel.size() > 0) {
- list.setSelectedIndex(0);
- } else {
- card.show(right, "none");
- }
- }
- }
-
- public class ButtonPane extends BasicPane {
- private CardLayout card;
- private JPanel centerPane;
- private UICheckBox icon, text, pdf, excelP, excelO, excelS, image, word,
- flashPrint, pdfPrint, appletPrint, serverPrint, isPopup, isVerify, failSubmit, isCurSheet;
- private UIBasicSpinner count;
- private Widget widget;
- private UITextField nameField;
- private IconDefinePane iconPane;
- private UIButton button;
- private JavaScriptActionPane javaScriptPane;
- private ExportToolBarProvider[] exportToolBarProviders;
-
- private ActionListener actionListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- if (isVerify.isSelected()) {
- failSubmit.setVisible(true);
- } else {
- failSubmit.setVisible(false);
- failSubmit.setSelected(false);
- }
- }
- };
-
- public ButtonPane() {
- this.initComponents();
- }
-
- /**
- * 初始化元素
- */
- public void initComponents() {
- Set set = ExtraDesignClassManager.getInstance().getArray(ExportToolBarProvider.XML_TAG);
- exportToolBarProviders = set.toArray(new ExportToolBarProvider[set.size()]);
- this.setLayout(FRGUIPaneFactory.createBorderLayout());
- JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
- icon = new UICheckBox(Inter.getLocText("FR-Designer_Show_Icon"));
- text = new UICheckBox(Inter.getLocText("FR-Designer_Show_Text"));
-
- north.add(icon, BorderLayout.NORTH);
- north.add(text, BorderLayout.CENTER);
-
- nameField = new UITextField(8);
- iconPane = new IconDefinePane();
- javaScriptPane = JavaScriptActionPane.createDefault();
-
- double p = TableLayout.PREFERRED;
- double rowSize[] = {p, p};
- double columnSize[] = {p, p};
-
- Component[][] coms = new Component[][]{{new UILabel(Inter.getLocText(new String[]{"Widget", "Printer-Alias"}) + ":"), nameField}, {new UILabel(Inter.getLocText(new String[]{"Widget", "Icon"}) + ":"), iconPane}};
-
- JPanel nameIconPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize);
-
- north.add(nameIconPane, BorderLayout.SOUTH);
-
- north.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"})));
- this.add(north, BorderLayout.NORTH);
- JPanel none = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
- centerPane = FRGUIPaneFactory.createCardLayout_S_Pane();
- card = new CardLayout();
- centerPane.setLayout(card);
- centerPane.add("custom", getCustomPane());
- centerPane.add("export", getExport());
- centerPane.add("print", getPrint());
- centerPane.add("none", none);
- centerPane.add("pdfprint", getPdfPrintSetting());
- // centerPane.add("editexcel", editExcel);
- centerPane.add(getCpane(), "appendcount");
- centerPane.add(getSubmitPane(), "submit");
+ private JWorkBook jwb;
+ private JList list;
+ private DefaultListModel listModel;
+ private JPanel right;
+ private CardLayout card;
+ private ButtonPane bp;
+ private ToolBarButton lastButton;
+ private Background background = null;
+ private UICheckBox defaultCheckBox;
+
+ private ListSelectionListener listSelectionListener = new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent evt) {
+ if (lastButton != null) {
+ lastButton.setWidget(bp.update());
+ }
+ if (list.getSelectedValue() instanceof ToolBarButton) {
+ lastButton = (ToolBarButton) list.getSelectedValue();
+ if (lastButton.getWidget() instanceof Button) {
+ card.show(right, "button");
+ bp.populate(lastButton.getWidget());
+ } else {
+ bp.populate(lastButton.getWidget());
+ card.show(right, "none");
+ }
+ }
+ }
+ };
+
+
+ private ActionListener actioner = new ActionListener() {
+ /**
+ *
+ */
+ public void actionPerformed(ActionEvent arg0) {
+ final BackgroundPane backgroundPane = new BackgroundPane();
+ BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame());
+ backgroundPane.populate(EditToolBar.this.background);
+ dialog.addDialogActionListener(new DialogActionAdapter() {
+ public void doOk() {
+ EditToolBar.this.background = backgroundPane.update();
+ if (EditToolBar.this.background != null) {
+ EditToolBar.this.defaultCheckBox.setSelected(false);
+ }
+ }
+ });
+ dialog.setVisible(true);
+ }
+ };
+
+ public EditToolBar() {
+ initComponent();
+ }
+
+ /**
+ * 初始化
+ */
+ public void initComponent() {
+ this.setLayout(FRGUIPaneFactory.createBorderLayout());
+ JPanel left = FRGUIPaneFactory.createBorderLayout_S_Pane();
+ listModel = new DefaultListModel();
+ list = new JList(listModel);
+ list.setCellRenderer(render);
+ left.add(new JScrollPane(list), BorderLayout.CENTER);
+ if (listModel.getSize() > 0) {
+ list.setSelectedIndex(0);
+ }
+
+ ToolBarDef toolbarDef = new ToolBarDef();
+ toolbarDef.addShortCut(new MoveUpItemAction());
+ toolbarDef.addShortCut(new MoveDownItemAction());
+ toolbarDef.addShortCut(new RemoveAction());
+ UIToolbar toolBar = ToolBarDef.createJToolBar();
+ toolbarDef.updateToolBar(toolBar);
+ left.add(toolBar, BorderLayout.NORTH);
+
+ right = FRGUIPaneFactory.createCardLayout_S_Pane();
+ card = new CardLayout();
+ right.setLayout(card);
+ bp = new ButtonPane();
+ right.add("none", FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane());
+ right.add("button", bp);
+
+ JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right);
+ // splitPane.setDividerLocation(left.getMinimumSize().width);
+ splitPane.setDividerLocation(120);
+ this.add(splitPane);
+ list.addListSelectionListener(listSelectionListener);
+ JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
+ UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"}));
+ defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"}));
+ bgButton.addActionListener(actioner);
+ backgroundPane.add(defaultCheckBox);
+ backgroundPane.add(bgButton);
+ backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"})));
+ this.add(backgroundPane, BorderLayout.SOUTH);
+ }
+
+ ListCellRenderer render = new DefaultListCellRenderer() {
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+ super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+
+ if (value instanceof ToolBarButton) {
+ ToolBarButton button = (ToolBarButton) value;
+ this.setText(button.getNameOption().optionName());
+ this.setIcon(button.getNameOption().optionIcon());
+ }
+ return this;
+ }
+ };
+
+ @Override
+ protected String title4PopupWindow() {
+ return Inter.getLocText("FR-Designer_Edit");
+ }
+
+ public void populate(FToolBar ftoolbar) {
+ this.populate(ftoolbar, null);
+ }
+
+ public void populate(FToolBar ftoolbar, ToolBarButton button) {
+ if (ftoolbar == null) {
+ return;
+ }
+ for (int i = 0; i < ftoolbar.getButtonlist().size(); i++) {
+ listModel.addElement(ftoolbar.getButtonlist().get(i));
+ }
+ this.list.validate();
+ this.list.repaint();
+ if (ftoolbar.getButtonlist().size() > 0) {
+ this.list.setSelectedIndex(0);
+ }
+ if (button != null) {
+ this.list.setSelectedValue(button, true);
+ }
+ this.background = ftoolbar.getBackground();
+
+ this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
+ }
+
+ public FToolBar update() {
+ if (this.list.getSelectedIndex() > -1) {
+ for (int i = 0; i < listModel.getSize(); i++) {
+ this.list.setSelectedIndex(i);
+ ToolBarButton toolBarButton = (ToolBarButton) this.list.getSelectedValue();
+ Widget widget = this.bp.update();
+ toolBarButton.setWidget(widget);
+ if (widget instanceof Button) {
+ String iconname = ((Button) widget).getIconName();
+ if (StringUtils.isNotBlank(iconname)) {
+ Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname);
+ toolBarButton.setIcon(new ImageIcon(iimage));
+ }
+ }
+ }
+ }
+ List list = new ArrayList();
+ for (int i = 0; i < listModel.size(); i++) {
+ list.add((ToolBarButton) listModel.get(i));
+ }
+ FToolBar ftoolBar = new FToolBar();
+ ftoolBar.setButtonlist(list);
+
+ ftoolBar.setDefault(this.defaultCheckBox.isSelected());
+ if (!ftoolBar.isDefault()) {
+ ftoolBar.setBackground(this.background);
+ }
+ return ftoolBar;
+ }
+
+ private class MoveUpItemAction extends UpdateAction {
+ public MoveUpItemAction() {
+ this.setName(Inter.getLocText("Utils-Move_Up"));
+ this.setMnemonic('U');
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
+ }
+
+ /**
+ *
+ */
+ public void actionPerformed(ActionEvent evt) {
+ int selectedIndex = list.getSelectedIndex();
+ if (selectedIndex == -1) {
+ return;
+ }
+
+ // 上移
+ if (selectedIndex > 0) {
+ DefaultListModel listModel = (DefaultListModel) list.getModel();
+
+ Object selecteObj1 = listModel.get(selectedIndex - 1);
+ listModel.set(selectedIndex - 1, listModel.get(selectedIndex));
+ listModel.set(selectedIndex, selecteObj1);
+
+ list.setSelectedIndex(selectedIndex - 1);
+ list.ensureIndexIsVisible(selectedIndex - 1);
+ list.validate();
+ }
+ }
+ }
+
+ private class MoveDownItemAction extends UpdateAction {
+ public MoveDownItemAction() {
+ this.setName(Inter.getLocText("Utils-Move_Down"));
+ this.setMnemonic('D');
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
+ }
+
+ /**
+ *
+ */
+ public void actionPerformed(ActionEvent evt) {
+ int selectedIndex = list.getSelectedIndex();
+ if (selectedIndex == -1) {
+ return;
+ }
+
+ // 下移
+ if (selectedIndex == -1) {
+ return;
+ }
+
+ if (selectedIndex < list.getModel().getSize() - 1) {
+ DefaultListModel listModel = (DefaultListModel) list.getModel();
+
+ Object selecteObj1 = listModel.get(selectedIndex + 1);
+ listModel.set(selectedIndex + 1, listModel.get(selectedIndex));
+ listModel.set(selectedIndex, selecteObj1);
+
+ list.setSelectedIndex(selectedIndex + 1);
+ list.ensureIndexIsVisible(selectedIndex + 1);
+ list.validate();
+ }
+ }
+ }
+
+ public class RemoveAction extends UpdateAction {
+ public RemoveAction() {
+ this.setName(Inter.getLocText("FR-Designer_Delete"));
+ this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
+ }
+
+ /**
+ * 动作
+ *
+ * @param e 事件
+ */
+ public void actionPerformed(ActionEvent e) {
+ int i = list.getSelectedIndex();
+ if (i < 0 || !(listModel.getElementAt(i) instanceof ToolBarButton)) {
+ return;
+ }
+ int val = JOptionPane.showConfirmDialog(EditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION);
+ if (val != JOptionPane.YES_OPTION) {
+ return;
+ }
+ listModel.removeElementAt(i);
+ list.validate();
+ if (listModel.size() > 0) {
+ list.setSelectedIndex(0);
+ } else {
+ card.show(right, "none");
+ }
+ }
+ }
+
+ public class ButtonPane extends BasicPane {
+ private CardLayout card;
+ private JPanel centerPane;
+ private UICheckBox icon, text, pdf, excelP, excelO, excelS, image, word,
+ flashPrint, pdfPrint, appletPrint, serverPrint, isPopup, isVerify, failSubmit,
+ isCurSheet, excelImClean, excelImCover, excelImAppend, excelImCust;
+ private UIBasicSpinner count;
+ private Widget widget;
+ private UITextField nameField;
+ private IconDefinePane iconPane;
+ private UIButton button;
+ private JavaScriptActionPane javaScriptPane;
+ private ExportToolBarProvider[] exportToolBarProviders;
+
+ private ActionListener actionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (isVerify.isSelected()) {
+ failSubmit.setVisible(true);
+ } else {
+ failSubmit.setVisible(false);
+ failSubmit.setSelected(false);
+ }
+ }
+ };
+
+ public ButtonPane() {
+ this.initComponents();
+ }
+
+ /**
+ * 初始化元素
+ */
+ public void initComponents() {
+ Set set = ExtraDesignClassManager.getInstance().getArray(ExportToolBarProvider.XML_TAG);
+ exportToolBarProviders = set.toArray(new ExportToolBarProvider[set.size()]);
+ this.setLayout(FRGUIPaneFactory.createBorderLayout());
+ JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
+ icon = new UICheckBox(Inter.getLocText("FR-Designer_Show_Icon"));
+ text = new UICheckBox(Inter.getLocText("FR-Designer_Show_Text"));
+
+ north.add(icon, BorderLayout.NORTH);
+ north.add(text, BorderLayout.CENTER);
+
+ nameField = new UITextField(8);
+ iconPane = new IconDefinePane();
+ javaScriptPane = JavaScriptActionPane.createDefault();
+
+ double p = TableLayout.PREFERRED;
+ double rowSize[] = {p, p};
+ double columnSize[] = {p, p};
+
+ Component[][] coms = new Component[][]{{new UILabel(Inter.getLocText(new String[]{"Widget", "Printer-Alias"}) + ":"), nameField}, {new UILabel(Inter.getLocText(new String[]{"Widget", "Icon"}) + ":"), iconPane}};
+
+ JPanel nameIconPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize);
+
+ north.add(nameIconPane, BorderLayout.SOUTH);
+
+ north.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"})));
+ this.add(north, BorderLayout.NORTH);
+ JPanel none = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
+ centerPane = FRGUIPaneFactory.createCardLayout_S_Pane();
+ card = new CardLayout();
+ centerPane.setLayout(card);
+ centerPane.add("custom", getCustomPane());
+ centerPane.add("export", getExport());
+ centerPane.add("import", getImport());
+ centerPane.add("print", getPrint());
+ centerPane.add("none", none);
+ centerPane.add("pdfprint", getPdfPrintSetting());
+ // centerPane.add("editexcel", editExcel);
+ centerPane.add(getCpane(), "appendcount");
+ centerPane.add(getSubmitPane(), "submit");
Set extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.updateCenterPane(centerPane);
}
- this.add(centerPane, BorderLayout.CENTER);
- }
-
-
- private JPanel getCustomPane() {
- JPanel customPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
-
- button = new UIButton(Inter.getLocText("FR-Designer_User_Defined_Event"));
- customPane.add(button);
- customPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Edit") + "JS", null));
- button.addActionListener(l);
- return customPane;
- }
-
- private JPanel getExport() {
- JPanel export = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
- // export.setLayout(new BoxLayout(export, BoxLayout.Y_AXIS));
- pdf = new UICheckBox(Inter.getLocText("FR-Designer_Output_PDF"));
- excelP = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Page"));
- excelO = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Simple"));
- excelS = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Sheet"));
- word = new UICheckBox(Inter.getLocText("FR-Designer_Output_Word"));
- image = new UICheckBox(Inter.getLocText("FR-Designer_Image"));
- export.add(pdf);
- export.add(Box.createVerticalStrut(2));
- export.add(excelP);
- export.add(Box.createVerticalStrut(2));
- export.add(excelO);
- export.add(Box.createVerticalStrut(2));
- export.add(excelS);
- export.add(Box.createVerticalStrut(2));
- export.add(word);
- export.add(Box.createVerticalStrut(2));
- export.add(image);
- for(int i=0; i extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
@@ -541,137 +564,157 @@ public class EditToolBar extends BasicPane {
}
}
- private void populateAppendColumnRow(){
- card.show(centerPane, "appendcount");
- count.setValue(((AppendColumnRow) widget).getCount());
- }
-
- private void populateExport(){
- card.show(centerPane, "export");
- Export export = (Export) widget;
- this.pdf.setSelected(export.isPdfAvailable());
- this.excelP.setSelected(export.isExcelPAvailable());
- this.excelO.setSelected(export.isExcelOAvailable());
- this.excelS.setSelected(export.isExcelSAvailable());
- this.word.setSelected(export.isWordAvailable());
- this.image.setSelected(export.isImageAvailable());
- if(exportToolBarProviders != null){
- for(int i=0; i extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.update(widget);
}
- return widget;
- }
-
- private void updateDefault(){
- ((Button) widget).setShowIcon(this.icon.isSelected());
- ((Button) widget).setShowText(this.text.isSelected());
- ((Button) widget).setText(this.nameField.getText());
- ((Button) widget).setIconName(this.iconPane.update());
- }
-
- private void updateSubmit(){
- Submit submit = ((Submit) widget);
- submit.setVerify(this.isVerify.isSelected());
- submit.setFailVerifySubmit(this.failSubmit.isSelected());
- submit.setOnlySubmitSelect(this.isCurSheet.isSelected());
- }
-
- private void updatePrint(){
- Print print = (Print) widget;
- print.setAppletPrint(this.appletPrint.isSelected());
- print.setFlashPrint(this.flashPrint.isSelected());
- print.setPDFPrint(this.pdfPrint.isSelected());
- print.setServerPrint(this.serverPrint.isSelected());
- }
-
- private void updateExport(){
- Export export = (Export) widget;
- export.setPdfAvailable(this.pdf.isSelected());
- export.setExcelPAvailable(this.excelP.isSelected());
- export.setExcelOAvailable(this.excelO.isSelected());
- export.setExcelSAvailable(this.excelS.isSelected());
- export.setWordAvailable(this.word.isSelected());
- export.setImageAvailable(this.image.isSelected());
- if(exportToolBarProviders != null){
- for(int i=0; i
+
+模版web属性相关界面
+
+