for (TreePath tp : tree.getSelectionPaths()) {
if (tp.getPathCount() == 3) {
String groupname = tp.getPath()[1].toString();
IViewport varname = (IViewport)((DefaultMutableTreeNode)tp.getPath()[2]).getUserObject();
if ((tree.getSelectionCount() == 1)) {
if (!Helper.yesno(
"Remove the Sweave-tag for " + varname + "?")) {
return;
}
}
if (groupname.equals(Constants.STRING_DATA_FILES)) {
Controller.rmDatafilefromLatex(varname.getSweaveTag());
}
if (groupname.equals(Constants.STRING_TABLES)) {
Controller.rmTagfromLatex(varname.getSweaveTag());
}
if (groupname.equals(Constants.STRING_PLOTS)) {
Controller.rmTagfromLatex(varname.getSweaveTag());
}
varname.setSweaveTag(null);
}
}
this.refresh();
}