xiaoxia 8 years ago
parent
commit
2fc18dc59f
  1. 32
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

32
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -5,11 +5,13 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.io.File;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.WebPreviewUtils;
@ -167,7 +169,13 @@ public class FormWidgetDetailPane extends FormDockView{
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
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.png")); UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download.png"));
UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download.png"));
UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download.png"));
menu.add(downloadItem); menu.add(downloadItem);
menu.add(installItem);
menu.add(deleteItem);
downloadItem.addActionListener(new ActionListener() { downloadItem.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -177,12 +185,36 @@ public class FormWidgetDetailPane extends FormDockView{
dlg.setVisible(true); dlg.setVisible(true);
} }
}); });
installItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileFilter(new FileNameExtensionFilter("zip", "zip"));
int returnValue = fileChooser.showDialog(new JLabel(), "选择");
if (returnValue == JFileChooser.APPROVE_OPTION) {
final File chosenFile = fileChooser.getSelectedFile();
installFromDiskZipFile(chosenFile);
}
}
});
deleteItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, tabbedPane.getY() + OFFSET_Y); GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, tabbedPane.getY() + OFFSET_Y);
} }
}); });
} }
private void installFromDiskZipFile(File chosenFile) {
}
/** /**
* 获取报表块组件分类 * 获取报表块组件分类
*/ */

Loading…
Cancel
Save