|
|
@ -2,11 +2,6 @@ package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
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.gui.frpane.UITabbedPane; |
|
|
|
import com.fr.design.gui.frpane.UITabbedPane; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
@ -16,11 +11,13 @@ import com.fr.design.gui.imenu.UIMenuItem; |
|
|
|
import com.fr.design.gui.imenu.UIPopupMenu; |
|
|
|
import com.fr.design.gui.imenu.UIPopupMenu; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.form.share.ShareConstants; |
|
|
|
|
|
|
|
import com.fr.form.share.ShareLoader; |
|
|
|
import com.fr.form.share.ShareLoader; |
|
|
|
import com.fr.form.ui.ElCaseBindInfo; |
|
|
|
import com.fr.form.ui.ElCaseBindInfo; |
|
|
|
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
|
|
|
|
import com.fr.share.ShareConstants; |
|
|
|
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
@ -44,16 +41,20 @@ import java.net.URISyntaxException; |
|
|
|
public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
|
|
|
|
|
|
|
|
private UITabbedPane tabbedPane; |
|
|
|
private UITabbedPane tabbedPane; |
|
|
|
private UIScrollPane downPanel; |
|
|
|
private UIScrollPane downPane; |
|
|
|
private JPanel reuWidgetPanel; |
|
|
|
private JPanel reuWidgetPanel; |
|
|
|
private UIComboBox comboBox; |
|
|
|
private UIComboBox comboBox; |
|
|
|
private ElCaseBindInfo[] elCaseBindInfoList; |
|
|
|
private ElCaseBindInfo[] elCaseBindInfoList; |
|
|
|
private UIButton downloadButton; |
|
|
|
|
|
|
|
private UIButton refreshButton; |
|
|
|
|
|
|
|
private UIButton deleteButton; |
|
|
|
private UIButton deleteButton; |
|
|
|
|
|
|
|
private UIButton resetButton; |
|
|
|
|
|
|
|
private JPanel editPanel; |
|
|
|
|
|
|
|
private JPanel resetPanel; |
|
|
|
|
|
|
|
private JPanel menutPanel; |
|
|
|
private static final int OFFSET_X = 140; |
|
|
|
private static final int OFFSET_X = 140; |
|
|
|
private static final int OFFSET_Y = 26; |
|
|
|
private static final int OFFSET_Y = 26; |
|
|
|
private SwingWorker sw; |
|
|
|
private SwingWorker sw; |
|
|
|
|
|
|
|
//组件面板是否可以编辑
|
|
|
|
|
|
|
|
private boolean isEdit; |
|
|
|
|
|
|
|
|
|
|
|
public static FormWidgetDetailPane getInstance() { |
|
|
|
public static FormWidgetDetailPane getInstance() { |
|
|
|
if (HOLDER.singleton == null) { |
|
|
|
if (HOLDER.singleton == null) { |
|
|
@ -99,7 +100,6 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
reuWidgetPanel.setBorder(null); |
|
|
|
reuWidgetPanel.setBorder(null); |
|
|
|
if (elCaseBindInfoList == null) { |
|
|
|
if (elCaseBindInfoList == null) { |
|
|
|
elCaseBindInfoList = new ElCaseBindInfo[0]; |
|
|
|
|
|
|
|
if (sw != null) { |
|
|
|
if (sw != null) { |
|
|
|
sw.cancel(true); |
|
|
|
sw.cancel(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -114,8 +114,6 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
sw.execute(); |
|
|
|
sw.execute(); |
|
|
|
} |
|
|
|
} |
|
|
|
initReuWidgetPanel(); |
|
|
|
initReuWidgetPanel(); |
|
|
|
createRefreshButton(); |
|
|
|
|
|
|
|
createDownloadButton(); |
|
|
|
|
|
|
|
initMenuPanel(); |
|
|
|
initMenuPanel(); |
|
|
|
tabbedPane = new UITabbedPane(); |
|
|
|
tabbedPane = new UITabbedPane(); |
|
|
|
tabbedPane.setOpaque(true); |
|
|
|
tabbedPane.setOpaque(true); |
|
|
@ -131,38 +129,74 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
* 初始化组件共享和复用面板 |
|
|
|
* 初始化组件共享和复用面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void initReuWidgetPanel() { |
|
|
|
private void initReuWidgetPanel() { |
|
|
|
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
reuWidgetPanel.add(downPanel); |
|
|
|
downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); |
|
|
|
|
|
|
|
reuWidgetPanel.add(downPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 初始化菜单栏面板 |
|
|
|
* 初始化菜单栏面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void initMenuPanel() { |
|
|
|
private void initMenuPanel() { |
|
|
|
JPanel menutPane = new JPanel(); |
|
|
|
menutPanel = new JPanel(); |
|
|
|
menutPane.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
menutPane.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3)); |
|
|
|
menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3)); |
|
|
|
menutPane.setPreferredSize(new Dimension(240, 48)); |
|
|
|
menutPanel.setPreferredSize(new Dimension(240, 48)); |
|
|
|
menutPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), |
|
|
|
menutPanel.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), |
|
|
|
SwingConstants.HORIZONTAL), BorderLayout.WEST); |
|
|
|
SwingConstants.HORIZONTAL), BorderLayout.WEST); |
|
|
|
JPanel buttonPanel = new JPanel(); |
|
|
|
|
|
|
|
buttonPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
menutPanel.add(initEditButtonPane(), BorderLayout.EAST); |
|
|
|
buttonPanel.add(refreshButton, BorderLayout.WEST); |
|
|
|
menutPanel.add(new JPanel(), BorderLayout.CENTER); |
|
|
|
buttonPanel.add(downloadButton, BorderLayout.EAST); |
|
|
|
|
|
|
|
menutPane.add(buttonPanel, BorderLayout.EAST); |
|
|
|
|
|
|
|
menutPane.add(new JPanel(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
comboBox = new UIComboBox(getFormCategories()); |
|
|
|
comboBox = new UIComboBox(getFormCategories()); |
|
|
|
comboBox.setPreferredSize(new Dimension(240, 30)); |
|
|
|
comboBox.setPreferredSize(new Dimension(240, 30)); |
|
|
|
initComboBoxSelectedListener(); |
|
|
|
initComboBoxSelectedListener(); |
|
|
|
menutPane.add(comboBox, BorderLayout.SOUTH); |
|
|
|
menutPanel.add(comboBox, BorderLayout.SOUTH); |
|
|
|
reuWidgetPanel.add(menutPane, BorderLayout.NORTH); |
|
|
|
reuWidgetPanel.add(menutPanel, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 创建菜单栏按钮面板 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private JPanel initEditButtonPane() { |
|
|
|
|
|
|
|
editPanel = new JPanel(); |
|
|
|
|
|
|
|
editPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
editPanel.add(createRefreshButton(), BorderLayout.WEST); |
|
|
|
|
|
|
|
editPanel.add(createDownloadButton(), BorderLayout.EAST); |
|
|
|
|
|
|
|
return editPanel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 创建取消删除面板 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private JPanel initResetButtonPane() { |
|
|
|
|
|
|
|
resetPanel = new JPanel(); |
|
|
|
|
|
|
|
resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset")); |
|
|
|
|
|
|
|
resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); |
|
|
|
|
|
|
|
resetButton.set4ToolbarButton(); |
|
|
|
|
|
|
|
resetButton.setOpaque(true); |
|
|
|
|
|
|
|
resetButton.setBackground(new Color(184, 220, 242)); |
|
|
|
|
|
|
|
resetButton.setForeground(Color.WHITE); |
|
|
|
|
|
|
|
resetButton.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
refreshDownPanel(false); |
|
|
|
|
|
|
|
replaceButtonPanel(false); |
|
|
|
|
|
|
|
reuWidgetPanel.remove(deleteButton); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
resetPanel.add(resetButton, BorderLayout.CENTER); |
|
|
|
|
|
|
|
return resetPanel; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initComboBoxSelectedListener() { |
|
|
|
private void initComboBoxSelectedListener() { |
|
|
|
comboBox.addItemListener(new ItemListener() { |
|
|
|
comboBox.addItemListener(new ItemListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
|
|
|
ShareLoader.getLoader().resetRemovedModuleList(); |
|
|
|
int filterIndex = comboBox.getSelectedIndex(); |
|
|
|
int filterIndex = comboBox.getSelectedIndex(); |
|
|
|
if (filterIndex == 0) { |
|
|
|
if (filterIndex == 0) { |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
@ -170,14 +204,17 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
String filterName = comboBox.getSelectedItem().toString(); |
|
|
|
String filterName = comboBox.getSelectedItem().toString(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); |
|
|
|
} |
|
|
|
} |
|
|
|
refreshDownPanel(false); |
|
|
|
refreshDownPanel(isEdit); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void createRefreshButton() { |
|
|
|
/** |
|
|
|
refreshButton = new UIButton(); |
|
|
|
* 创建刷新按钮 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private UIButton createRefreshButton() { |
|
|
|
|
|
|
|
UIButton refreshButton = new UIButton(); |
|
|
|
refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png")); |
|
|
|
refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png")); |
|
|
|
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh")); |
|
|
|
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh")); |
|
|
|
refreshButton.set4ToolbarButton(); |
|
|
|
refreshButton.set4ToolbarButton(); |
|
|
@ -192,6 +229,7 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
protected Object doInBackground() throws Exception { |
|
|
|
protected Object doInBackground() throws Exception { |
|
|
|
ShareLoader.getLoader().refreshModule(); |
|
|
|
ShareLoader.getLoader().refreshModule(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
|
|
|
|
refreshComboxData(); |
|
|
|
refreshDownPanel(false); |
|
|
|
refreshDownPanel(false); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -199,29 +237,43 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
sw.execute(); |
|
|
|
sw.execute(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
return refreshButton; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void refreshComboxData() { |
|
|
|
|
|
|
|
comboBox.setSelectedIndex(0); |
|
|
|
|
|
|
|
comboBox.setModel(new DefaultComboBoxModel(getFormCategories())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建下载模板的按钮 |
|
|
|
* 创建下载模板的按钮 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void createDownloadButton() { |
|
|
|
private UIButton createDownloadButton() { |
|
|
|
downloadButton = new UIButton(); |
|
|
|
UIButton downloadButton = new UIButton(); |
|
|
|
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png")); |
|
|
|
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png")); |
|
|
|
downloadButton.set4ToolbarButton(); |
|
|
|
downloadButton.set4ToolbarButton(); |
|
|
|
downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template")); |
|
|
|
downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template")); |
|
|
|
downloadButton.addActionListener(new ActionListener() { |
|
|
|
downloadButton.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
initPopMenu(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return downloadButton; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 初始化下拉面板 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void initPopMenu() { |
|
|
|
UIPopupMenu menu = new UIPopupMenu(); |
|
|
|
UIPopupMenu menu = new UIPopupMenu(); |
|
|
|
UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); |
|
|
|
UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); |
|
|
|
UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); |
|
|
|
UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); |
|
|
|
UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png")); |
|
|
|
UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png")); |
|
|
|
|
|
|
|
|
|
|
|
menu.add(downloadItem); |
|
|
|
menu.add(downloadItem); |
|
|
|
menu.add(installItem); |
|
|
|
menu.add(installItem); |
|
|
|
menu.add(deleteItem); |
|
|
|
menu.add(deleteItem); |
|
|
|
|
|
|
|
|
|
|
|
downloadItem.addActionListener(new ActionListener() { |
|
|
|
downloadItem.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
@ -233,7 +285,7 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
try { |
|
|
|
try { |
|
|
|
Desktop.getDesktop().browse(new URI(url)); |
|
|
|
Desktop.getDesktop().browse(new URI(url)); |
|
|
|
} catch (IOException exp) { |
|
|
|
} catch (IOException exp) { |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
} catch (URISyntaxException exp) { |
|
|
|
} catch (URISyntaxException exp) { |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
@ -241,57 +293,50 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
|
|
|
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
installItem.addActionListener(new ActionListener() { |
|
|
|
installItem.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
JFileChooser fileChooser = new JFileChooser(); |
|
|
|
JFileChooser fileChooser = new JFileChooser(); |
|
|
|
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); |
|
|
|
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); |
|
|
|
fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); |
|
|
|
fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); |
|
|
|
int returnValue = fileChooser.showDialog(new JLabel(), Inter.getLocText("FR-Designer_Select")); |
|
|
|
int returnValue = fileChooser.showDialog(new UILabel(), Inter.getLocText("FR-Designer_Select")); |
|
|
|
if (returnValue == JFileChooser.APPROVE_OPTION) { |
|
|
|
if (returnValue == JFileChooser.APPROVE_OPTION) { |
|
|
|
final File chosenFile = fileChooser.getSelectedFile(); |
|
|
|
final File chosenFile = fileChooser.getSelectedFile(); |
|
|
|
installFromDiskZipFile(chosenFile); |
|
|
|
installFromDiskZipFile(chosenFile); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
deleteItem.addActionListener(new ActionListener() { |
|
|
|
deleteItem.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
replaceButtonPanel(true); |
|
|
|
deleteFromDiskZipFile(); |
|
|
|
deleteFromDiskZipFile(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); |
|
|
|
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void deleteFromDiskZipFile() { |
|
|
|
private void deleteFromDiskZipFile() { |
|
|
|
deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove")); |
|
|
|
deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove")); |
|
|
|
deleteButton.setOpaque(true); |
|
|
|
|
|
|
|
deleteButton.setBackground(Color.red); |
|
|
|
deleteButton.setBackground(Color.red); |
|
|
|
|
|
|
|
deleteButton.repaint(); |
|
|
|
deleteButton.setPreferredSize(new Dimension(240, 40)); |
|
|
|
deleteButton.setPreferredSize(new Dimension(240, 40)); |
|
|
|
reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH); |
|
|
|
reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH); |
|
|
|
deleteButton.addActionListener(new ActionListener() { |
|
|
|
deleteButton.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
if(ShareLoader.getLoader().removeModulesFromList()) { |
|
|
|
if (ShareLoader.getLoader().removeModulesFromList()) { |
|
|
|
refreshShareMoudule(); |
|
|
|
refreshShareMoudule(); |
|
|
|
reuWidgetPanel.remove(deleteButton); |
|
|
|
reuWidgetPanel.remove(deleteButton); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful")); |
|
|
|
refreshDownPanel(false); |
|
|
|
refreshDownPanel(false); |
|
|
|
|
|
|
|
replaceButtonPanel(false); |
|
|
|
|
|
|
|
refreshComboxData(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
reuWidgetPanel.remove(deleteButton); |
|
|
|
|
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed")); |
|
|
|
refreshDownPanel(false); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -300,25 +345,44 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void replaceButtonPanel(boolean isEdit) { |
|
|
|
|
|
|
|
this.isEdit = isEdit; |
|
|
|
|
|
|
|
if (isEdit) { |
|
|
|
|
|
|
|
menutPanel.remove(editPanel); |
|
|
|
|
|
|
|
menutPanel.add(initResetButtonPane(), BorderLayout.EAST); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
menutPanel.remove(resetPanel); |
|
|
|
|
|
|
|
menutPanel.add(initEditButtonPane(), BorderLayout.EAST); |
|
|
|
|
|
|
|
ShareLoader.getLoader().resetRemovedModuleList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void installFromDiskZipFile(File chosenFile) { |
|
|
|
private void installFromDiskZipFile(File chosenFile) { |
|
|
|
|
|
|
|
if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile); |
|
|
|
if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { |
|
|
|
refreshShareMoudule(); |
|
|
|
refreshShareMoudule(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); |
|
|
|
refreshDownPanel(false); |
|
|
|
refreshDownPanel(false); |
|
|
|
|
|
|
|
refreshComboxData(); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); |
|
|
|
e.printStackTrace(); |
|
|
|
FRLogger.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void refreshShareMoudule() { |
|
|
|
private void refreshShareMoudule() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
ShareLoader.getLoader().refreshModule(); |
|
|
|
ShareLoader.getLoader().refreshModule(); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
FRLogger.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -326,15 +390,15 @@ public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
* 获取报表块组件分类 |
|
|
|
* 获取报表块组件分类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String[] getFormCategories() { |
|
|
|
public String[] getFormCategories() { |
|
|
|
return ShareConstants.WIDGET_CATEGORIES; |
|
|
|
return ArrayUtils.addAll(new String[] {Inter.getLocText("FR-Designer_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void refreshDownPanel(boolean isEdit) { |
|
|
|
public void refreshDownPanel(boolean isEdit) { |
|
|
|
reuWidgetPanel.remove(downPanel); |
|
|
|
reuWidgetPanel.remove(downPane); |
|
|
|
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); |
|
|
|
downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); |
|
|
|
reuWidgetPanel.add(downPanel); |
|
|
|
reuWidgetPanel.add(downPane); |
|
|
|
repaintContainer(); |
|
|
|
repaintContainer(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|