}
public JMenuItem getPopupPresenter() {
JMenuPlus menu = new JMenuPlus(DEPLOY_LABEL);
JMenuItem item, user, share;
final OfficeInstallation oi = OfficeSettings.getDefault().getOfficeDirectory();
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
JMenuItem choice = (JMenuItem)e.getSource();
String label = choice.getText();
Node[] nodes = getActivatedNodes();
final ParcelCookie parcelCookie =
(ParcelCookie)nodes[0].getCookie(ParcelCookie.class);
File target = new File(oi.getPath(File.separator + label +
File.separator + "Scripts"));
File langdir = new File(target, parcelCookie.getLanguage());
if (!langdir.exists()) {
boolean response = askIfCreateDirectory(langdir);
if (response == false) {
return;
}
}
deploy(target);
}
};
user = new JMenuItem("user");
user.addActionListener(listener);
share = new JMenuItem("share");
share.addActionListener(listener);
item = new JMenuPlus(oi.getName());
item.add(user);
item.add(share);
menu.add(item);
menu.addSeparator();