Implements Deleteform Text

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4688 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
baka 2017-04-24 13:16:27 +00:00
parent 2a1f8e8849
commit 8a170c207c
1 changed files with 24 additions and 30 deletions

View File

@ -32,6 +32,7 @@ import com.arsdigita.toolbox.ui.Section;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.libreccm.categorization.Categorization;
import org.libreccm.categorization.Category; import org.libreccm.categorization.Category;
import org.libreccm.categorization.CategoryManager; import org.libreccm.categorization.CategoryManager;
import org.libreccm.categorization.CategoryRepository; import org.libreccm.categorization.CategoryRepository;
@ -171,36 +172,29 @@ public final class CategoryAdminPane extends BaseAdminPane {
DeleteForm(SimpleContainer prompt) { DeleteForm(SimpleContainer prompt) {
super(prompt); super(prompt);
prompt.add(new Label(gz("cms.ui.category.delete_prompt"))); prompt.add(new Label(gz("cms.ui.category.delete_prompt")));
Label catLabel = new Label(gz("PLACEHOLDER TEXT")); Label catLabel = new Label();
// catLabel.addPrintListener(new PrintListener() { catLabel.addPrintListener(pe -> {
// public void prepare(PrintEvent pe) { Label label = (Label) pe.getTarget();
// Label label = (Label) pe.getTarget(); Category cat =
// Category cat = m_category.getCategory(pe.getPageState());
// m_category.getCategory(pe.getPageState()); java.util.List<Category> descendants = cat.getSubCategories();
// CategoryCollection descendants = cat.getDescendants(); java.util.List<Categorization> catObjects = cat.getObjects();
// final long nDescendants = descendants.size() - 1;
// descendants.close(); StringBuffer sb = new StringBuffer(" ");
// CategorizedCollection descObjects = if (descendants.size() > 0) {
// cat.getDescendantObjects(); sb.append("This category has ");
// final long nDescObjects = descObjects.size(); sb.append(descendants.size());
// descObjects.close(); sb.append(" descendant category(ies). ");
// StringBuffer sb = new StringBuffer(" "); }
// if (nDescendants > 0) { if (catObjects.size() > 0) {
// sb.append("This category has "); sb.append("It has ").append(catObjects.size());
// sb.append(nDescendants); sb.append(" descendant object(s). ");
// sb.append(" descendant category(ies). "); }
// } if (descendants.size() > 0 || catObjects.size() > 0) {
// if (nDescObjects > 0) { sb.append("Descendants will be orphaned, if this category is removed.");
// sb.append("It has ").append(nDescObjects); }
// sb.append(" descendant object(s). "); label.setLabel(gz(sb.toString()));
// } });
// if (nDescendants > 0 || nDescObjects > 0) {
// sb.append("Descendants will be orphaned, if this category is removed.");
// }
// label.setLabel(sb.toString());
// }
//
// });
prompt.add(catLabel); prompt.add(catLabel);
} }