/** * {@inheritDoc} * <p> * May be replaced or extended by subclasses. * </p> */ @Override public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
/** * {@inheritDoc} * <p> * May be replaced or extended by subclasses. * </p> * * @since 2.2 */ public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
/** * Returns true if the specified offset is within the partition * managed by this document. * * @param pos an offset within this document * @return true if the offset is within this document's partition */ public boolean inPartition(int pos) { final ITypedRegion partition= getPartition(pos); return partition != null && partition.getType().equals(fPartition); }
public IToken nextToken() { if (lastComputed == null || lastComputed.partitions == null || ++index >= lastComputed.partitions.length) { return Token.EOF; } return new Token(lastComputed.partitions[index].getType()); }
/** * {@inheritDoc} * <p> * May be replaced or extended by subclasses. * </p> */ public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
/** * {@inheritDoc} * <p> * May be replaced or extended by subclasses. * </p> */ public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
/** * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>. * * @param position the position to be checked * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise */ public boolean isDefaultPartition(int position) { return fPartition.equals(getPartition(position).getType()); }
/** * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>. * * @param position the position to be checked * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise */ public boolean isDefaultPartition(int position) { return fPartition.equals(getPartition(position).getType()); }
/** * Returns true if the specified offset is within the partition * managed by this document. * * @param pos an offset within this document * @return true if the offset is within this document's partition */ public boolean inPartition(int pos) { final ITypedRegion partition= getPartition(pos); return partition != null && partition.getType().equals(fPartition); }
/** * Checks whether <code>position</code> resides in a default (Java) partition of <code>fDocument</code>. * * @param position the position to be checked * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise */ public boolean isDefaultPartition(int position) { return fPartition.equals(getPartition(position).getType()); }
/** * {@inheritDoc} * <p> * May be replaced or extended by subclasses. * </p> */ @Override public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
@Override public String getContentType(int offset) { final ITypedRegion partition = getPartition(offset); return partition == null ? null : partition.getType(); }
public String getContentType(int offset, boolean preferOpenPartitions) { final ITypedRegion partition = getPartition(offset); return partition == null ? null : partition.getType(); }
@Override public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
@Override public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
@Override public String getContentType(int offset, boolean preferOpenPartitions) { return getPartition(offset, preferOpenPartitions).getType(); }
/** * Creates a position based on the typed region. * * @param region the typed region */ public TypedPosition(ITypedRegion region) { super(region.getOffset(), region.getLength()); fType= region.getType(); }
/** * Creates a position based on the typed region. * * @param region the typed region */ public TypedPosition(ITypedRegion region) { super(region.getOffset(), region.getLength()); fType= region.getType(); }
public int findNextOffSetInPartition(IDocument doc, int partitionOffSet, int minIndex) throws BadLocationException { ITypedRegion partition = doc.getPartition(partitionOffSet); ITypedRegion partition2 = doc.getPartition(minIndex); if (partition.getType().equals(partition2.getType()) || partition2.getLength() == 0) { return minIndex; } else { return findNextOffSetInPartition(doc, partitionOffSet, minIndex + partition2.getLength()); } } }