public String title(){ return Messages.get( this, name() + ".title"); }
public String pageTitle( String page ){ return Messages.get( this, name() + "." + page + ".title"); }
public String pageBody( String page ){ return Messages.get( this, name() + "." + page + ".body"); }
public String title(){ return Messages.get( this, name() + ".title"); }
public String pageTitle( String page ){ return Messages.get( this, name() + "." + page + ".title"); }
public String pageBody( String page ){ return Messages.get( this, name() + "." + page + ".body"); }
public static void restore( Bundle bundle ){ if (!bundle.contains( DOCUMENTS )){ return; } Bundle docBundle = bundle.getBundle( DOCUMENTS ); for ( Document doc : values()){ if (docBundle.contains(doc.name())){ List<String> pages = Arrays.asList(docBundle.getStringArray(doc.name())); for (String page : pages){ if (doc.pages.containsKey(page)) { doc.pages.put(page, true); } } } } }
public static void restore( Bundle bundle ){ if (!bundle.contains( DOCUMENTS )){ return; } Bundle docBundle = bundle.getBundle( DOCUMENTS ); for ( Document doc : values()){ if (docBundle.contains(doc.name())){ List<String> pages = Arrays.asList(docBundle.getStringArray(doc.name())); for (String page : pages){ if (doc.pages.containsKey(page)) { doc.pages.put(page, true); } } } } }
public static void store( Bundle bundle ){ Bundle docBundle = new Bundle(); for ( Document doc : values()){ ArrayList<String> pages = new ArrayList<>(); for (String page : doc.pages()){ if (doc.pages.get(page)){ pages.add(page); } } if (!pages.isEmpty()) { docBundle.put(doc.name(), pages.toArray(new String[0])); } } bundle.put( DOCUMENTS, docBundle ); }
public static void store( Bundle bundle ){ Bundle docBundle = new Bundle(); for ( Document doc : values()){ ArrayList<String> pages = new ArrayList<>(); for (String page : doc.pages()){ if (doc.pages.get(page)){ pages.add(page); } } if (!pages.isEmpty()) { docBundle.put(doc.name(), pages.toArray(new String[0])); } } bundle.put( DOCUMENTS, docBundle ); }