/** * Returns the tab size set for the document, defaulting to 5. * * @return The tab size. */ private int getTabSize() { Integer i = (Integer)getDocument().getProperty( PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 5; return size; }
/** * Returns the tab size set for the document, defaulting to 5. * * @return the tab size */ protected int getTabSize() { Integer i = (Integer) getDocument(). getProperty(PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 5; return size; }
/** * Returns the line separator used when writing this file (e.g. * "<code>\n</code>", "<code>\r\n</code>", or "<code>\r</code>").<p> * * Note that this value is an <code>Object</code> and not a * <code>String</code> as that is the way the {@link Document} interface * defines its property values. If you always use * {@link #setLineSeparator(String)} to modify this value, then the value * returned from this method will always be a <code>String</code>. * * @return The line separator. If this value is <code>null</code>, then * the system default line separator is used (usually the value * of <code>System.getProperty("line.separator")</code>). * @see #setLineSeparator(String) * @see #setLineSeparator(String, boolean) */ public Object getLineSeparator() { return getDocument().getProperty( RTextAreaEditorKit.EndOfLineStringProperty); }
title = (String) d.getProperty(HTMLDocument.TitleProperty);
Object old = doc.getProperty( RTextAreaEditorKit.EndOfLineStringProperty); if (!separator.equals(old)) {
private TransformationTable getCachedMacroTable(Document doc) { Object o = doc.getProperty(MACRO_EXPANSION_MACRO_TABLE); if (o != null && o instanceof TransformationTable) { TransformationTable tt = (TransformationTable) o; return tt; } return null; }
/** * @param doc * @return filename from which the document is loaded. */ private static String getFilename(Document doc) { String ret = (String) doc.getProperty(javax.swing.text.Document.TitleProperty); return (ret == null ? "UNKNOWN" : ret); // NOI18N }
/** * Display the identity of the document together with the title property and * stream-description property. */ public static String debugDocument(Document doc) { return "<" + System.identityHashCode(doc) + ", title='" + doc.getProperty(Document.TitleProperty) + "', stream='" + doc.getProperty(Document.StreamDescriptionProperty) + ", " + doc.toString() + ">"; }
protected int toComponentPosition(JTextComponent component, int position) { int[] windowsLineEndings = (int[])component.getDocument().getProperty(WINDOWS_LINE_ENDINGS); if (windowsLineEndings == null || windowsLineEndings.length == 0) { return position; } int index = Arrays.binarySearch(windowsLineEndings, position); if (index >= 0) { return position - index; } return position - (-index - 1); }
protected int toComponentPosition(JTextComponent component, int position) { int[] windowsLineEndings = (int[])component.getDocument().getProperty(WINDOWS_LINE_ENDINGS); if (windowsLineEndings == null || windowsLineEndings.length == 0) { return position; } int index = Arrays.binarySearch(windowsLineEndings, position); if (index >= 0) { return position - index; } return position - (-index - 1); }
protected int toComponentPosition(JTextComponent component, int position) { int[] windowsLineEndings = (int[])component.getDocument().getProperty(WINDOWS_LINE_ENDINGS); if (windowsLineEndings == null || windowsLineEndings.length == 0) { return position; } int index = Arrays.binarySearch(windowsLineEndings, position); if (index >= 0) { return position - index; } return position - (-index - 1); }
public Object getProperty(Object key) { if (key == DocumentFilter.class && original instanceof AbstractDocument) { return ((AbstractDocument)original).getDocumentFilter(); } return original.getProperty(key); }
private String getShortName() { String longname = (String) getDocument().getProperty(Document.TitleProperty); int slash = longname.lastIndexOf(File.separatorChar); if (slash != -1) { return longname.substring(slash + 1); } else { return longname; } }
/** * Returns the tab size set for the document, defaulting to 5. * * @return the tab size */ protected int getTabSize() { Integer i = (Integer) getDocument(). getProperty(PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 5; return size; }
/** * Returns the tab size set for the document, defaulting to 5. * * @return The tab size. */ protected int getTabSize() { Integer i = (Integer)getDocument().getProperty( PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 5; return size; }
/** * Returns the tab size set for the document, defaulting to 5. * * @return The tab size. */ private int getTabSize() { Integer i = (Integer)getDocument().getProperty( PlainDocument.tabSizeAttribute); int size = (i != null) ? i.intValue() : 5; return size; }
public static @NonNull DocumentCharacterAcceptor get(Document doc) { DocumentCharacterAcceptor acceptor = (DocumentCharacterAcceptor) doc.getProperty( DocumentCharacterAcceptor.class); if (acceptor == null) { acceptor = DefaultDocumentCharacterAcceptor.INSTANCE; } return acceptor; }
static synchronized OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(DebuggerAnnotation.class); if (bag == null) { doc.putProperty(DebuggerAnnotation.class, bag = new OffsetsBag(doc, true)); } return bag; }
static synchronized OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(DebuggerAnnotation.class); if (bag == null) { doc.putProperty(DebuggerAnnotation.class, bag = new OffsetsBag(doc, true)); } return bag; }
public void focusGained(FocusEvent evt) { if (debugCaretFocus) { System.err.println("BaseCaret.focusGained() in doc=" + component.getDocument().getProperty(Document.TitleProperty)); } JTextComponent c = component; if (c != null) { updateType(); setVisible(c.isEnabled()); // invisible caret if disabled } }