private void defineLocalDestinationOnFirstChunk(Paragraph p, String anchor) { for (Element e : p) { if (e instanceof Chunk) { Chunk c = (Chunk) e; c.setLocalDestination(anchor); return; } } throw new IllegalStateException("No chunk found"); }
/** * Create an index entry. * * @param text The text. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. */ public void create(final Chunk text, final String in1, final String in2, final String in3) { String tag = "idx_" + indexcounter++; text.setGenericTag(tag); text.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); }
/** * Create an index entry. * * @param text The text. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. */ public void create(final Chunk text, final String in1, final String in2, final String in3) { String tag = "idx_" + indexcounter++; text.setGenericTag(tag); text.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); }
chunk = i.next(); if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false;
/** * Create an index entry. * * @param text The text for the Chunk. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. * @return Returns the Chunk. */ public Chunk create(final String text, final String in1, final String in2, final String in3) { Chunk chunk = new Chunk(text); String tag = "idx_" + indexcounter++; chunk.setGenericTag(tag); chunk.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); return chunk; }
/** * Applies the properties of the Anchor to a Chunk. * @param chunk the Chunk (part of the Anchor) * @param notGotoOK if true, this chunk will determine the local destination * @param localDestination true if the chunk is a local goto and the reference a local destination * @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination */ protected boolean applyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination) { if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false; } if (localDestination) { chunk.setLocalGoto(reference.substring(1)); } else if (reference != null) chunk.setAnchor(reference); return notGotoOK; }
/** * Create an index entry. * * @param text The text for the Chunk. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. * @return Returns the Chunk. */ public Chunk create(final String text, final String in1, final String in2, final String in3) { Chunk chunk = new Chunk(text); String tag = "idx_" + indexcounter++; chunk.setGenericTag(tag); chunk.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); return chunk; }
/** * Applies the properties of the Anchor to a Chunk. * @param chunk the Chunk (part of the Anchor) * @param notGotoOK if true, this chunk will determine the local destination * @param localDestination true if the chunk is a local goto and the reference a local destination * @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination */ protected boolean applyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination) { if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false; } if (localDestination) { chunk.setLocalGoto(reference.substring(1)); } else if (reference != null) chunk.setAnchor(reference); return notGotoOK; }
chunk = i.next(); if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false;