|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
import java.util.*; |
|
|
|
@ -10,12 +12,26 @@ import javax.swing.*;
|
|
|
|
|
import javax.swing.border.LineBorder; |
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.design.actions.file.WebPreviewUtils; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
|
import com.fr.design.extra.PluginWebBridge; |
|
|
|
|
import com.fr.design.extra.ShopDialog; |
|
|
|
|
import com.fr.design.extra.WebManagerPaneFactory; |
|
|
|
|
import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
|
import com.fr.design.file.MutilTempalteTabPane; |
|
|
|
|
import com.fr.design.gui.frpane.UITabbedPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ibutton.UIPreviewButton; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.imenu.UIMenuItem; |
|
|
|
|
import com.fr.design.gui.imenu.UIPopupMenu; |
|
|
|
|
import com.fr.design.gui.itoolbar.UILargeToolbar; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.form.share.ShareConstants; |
|
|
|
|
import com.fr.form.share.ShareLoader; |
|
|
|
|
import com.fr.form.ui.ElCaseBindInfo; |
|
|
|
@ -30,10 +46,13 @@ import com.fr.general.Inter;
|
|
|
|
|
public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
|
|
|
|
|
|
private UITabbedPane tabbedPane; |
|
|
|
|
private JScrollPane downPanel; |
|
|
|
|
private UIScrollPane downPanel; |
|
|
|
|
private JPanel reuWidgetPanel; |
|
|
|
|
private UIComboBox comboBox; |
|
|
|
|
private ElCaseBindInfo[] elCaseBindInfoList; |
|
|
|
|
private UIButton downloadButton; |
|
|
|
|
private static final int OFFSET_X = 140; |
|
|
|
|
private static final int OFFSET_Y = 26; |
|
|
|
|
|
|
|
|
|
public static FormWidgetDetailPane getInstance() { |
|
|
|
|
if (HOLDER.singleton == null) { |
|
|
|
@ -84,14 +103,12 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
} |
|
|
|
|
initReuWidgetPanel(); |
|
|
|
|
esp.add(reuWidgetPanel, BorderLayout.CENTER); |
|
|
|
|
UIButton button = new UIButton(); |
|
|
|
|
button.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download.png")); |
|
|
|
|
button.set4ToolbarButton(); |
|
|
|
|
createDownloadButton(); |
|
|
|
|
JPanel widgetPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
widgetPane.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3)); |
|
|
|
|
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), |
|
|
|
|
SwingConstants.HORIZONTAL), BorderLayout.WEST); |
|
|
|
|
widgetPane.add(button, BorderLayout.EAST); |
|
|
|
|
widgetPane.add(downloadButton, BorderLayout.EAST); |
|
|
|
|
esp.add(widgetPane,BorderLayout.NORTH); |
|
|
|
|
tabbedPane = new UITabbedPane(); |
|
|
|
|
tabbedPane.setOpaque(true); |
|
|
|
@ -110,8 +127,8 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
int rowCount = (elCaseBindInfoList.length + 1)/2; |
|
|
|
|
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); |
|
|
|
|
downPanel.setPreferredSize(new Dimension(236, rowCount * 82)); |
|
|
|
|
reuWidgetPanel = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); |
|
|
|
|
comboBox = new UIComboBox(getCategories()); |
|
|
|
|
reuWidgetPanel = new JPanel(); |
|
|
|
|
comboBox = new UIComboBox(getFormCategories()); |
|
|
|
|
comboBox.setPreferredSize(new Dimension(236, 30)); |
|
|
|
|
initComboBoxSelectedListener(); |
|
|
|
|
reuWidgetPanel.add(comboBox, BorderLayout.NORTH); |
|
|
|
@ -136,10 +153,43 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String[] getCategories() { |
|
|
|
|
/** |
|
|
|
|
* 创建下载模板的按钮 |
|
|
|
|
*/ |
|
|
|
|
private void createDownloadButton() { |
|
|
|
|
downloadButton = new UIButton(); |
|
|
|
|
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png")); |
|
|
|
|
downloadButton.set4ToolbarButton(); |
|
|
|
|
downloadButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
UIPopupMenu menu = new UIPopupMenu(); |
|
|
|
|
UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download.png")); |
|
|
|
|
menu.add(downloadItem); |
|
|
|
|
downloadItem.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
BasicPane managerPane = new WebManagerPaneFactory().createReusePane(); |
|
|
|
|
UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); |
|
|
|
|
PluginWebBridge.getHelper().setDialogHandle(dlg); |
|
|
|
|
dlg.setVisible(true); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, tabbedPane.getY() + OFFSET_Y); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取报表块组件分类 |
|
|
|
|
*/ |
|
|
|
|
public String[] getFormCategories() { |
|
|
|
|
return ShareConstants.WIDGET_CATEGORIES; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void refreshDownPanel() { |
|
|
|
|
reuWidgetPanel.remove(downPanel); |
|
|
|
|
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList)); |
|
|
|
|