/** Sets the logical style for a given offset within the document. @param offset The offset within the document. @param style The logical style. **/ public synchronized void setLogicalStyle (int offset, Style style) { document_.setLogicalStyle (offset, style); }
/** * {@inheritDoc} */ @Override public void setLogicalStyle(int pos, Style s) { ((StyledDocument) delegate).setLogicalStyle(pos, s); }
/** * {@inheritDoc} */ public void setLogicalStyle(int pos, Style s) { ((StyledDocument) delegate).setLogicalStyle(pos, s); }
public void setLogicalStyle(int pos, Style s) { ((StyledDocument) original).setLogicalStyle(pos, s); }
public void setLogicalStyle(int pos, Style s) { ((StyledDocument)original).setLogicalStyle (pos, s); }
/** * {@inheritDoc} */ @Override public void setLogicalStyle(int pos, Style s) { ((StyledDocument) delegate).setLogicalStyle(pos, s); }
public void setLogicalStyle(int pos, Style s) { ((StyledDocument)original).setLogicalStyle (pos, s); }
/** * Mark a line as normal (no special attributes). * This uses the dummy style named {@link #NORMAL_STYLE_NAME}. * This method should be used to undo the effect of {@link #markBreakpoint}, {@link #markError} and {@link #markCurrent}. * @param doc the document * @param offset identified the line to unmark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ @Deprecated public static void markNormal(StyledDocument doc, int offset) { checkDocParameter(doc); Style st = doc.getStyle(NORMAL_STYLE_NAME); if (st == null) { st = doc.addStyle(NORMAL_STYLE_NAME, null); } if (st != null) { doc.setLogicalStyle(offset, st); } }
/** * Mark a line as normal (no special attributes). * This uses the dummy style named {@link #NORMAL_STYLE_NAME}. * This method should be used to undo the effect of {@link #markBreakpoint}, {@link #markError} and {@link #markCurrent}. * @param doc the document * @param offset identified the line to unmark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markNormal (StyledDocument doc, int offset) { checkDocParameter(doc); Style st = doc.getStyle (NORMAL_STYLE_NAME); if (st == null) st = doc.addStyle (NORMAL_STYLE_NAME, null); if (st != null) { doc.setLogicalStyle (offset, st); } }
/** * Mark a line as normal (no special attributes). * This uses the dummy style named {@link #NORMAL_STYLE_NAME}. * This method should be used to undo the effect of {@link #markBreakpoint}, {@link #markError} and {@link #markCurrent}. * @param doc the document * @param offset identified the line to unmark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markNormal (StyledDocument doc, int offset) { checkDocParameter(doc); Style st = doc.getStyle (NORMAL_STYLE_NAME); if (st == null) st = doc.addStyle (NORMAL_STYLE_NAME, null); if (st != null) { doc.setLogicalStyle (offset, st); } }
/** Attach a breakpoint to a line in the document. * If the document has a defined style named {@link #BREAKPOINT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to set breakpoint to * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ @Deprecated public static void markBreakpoint(StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle(BREAKPOINT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle(BREAKPOINT_STYLE_NAME, null); if (bp == null) { return; } bp.addAttribute(StyleConstants.ColorConstants.Background, Color.red); bp.addAttribute(StyleConstants.ColorConstants.Foreground, Color.white); } doc.setLogicalStyle(offset, bp); }
/** Mark a line as erroneous (e.g. by the compiler). * If the document has a defined style named {@link #ERROR_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ @Deprecated public static void markError(StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle(ERROR_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle(ERROR_STYLE_NAME, null); if (bp == null) { return; } bp.addAttribute(StyleConstants.ColorConstants.Background, Color.green); bp.addAttribute(StyleConstants.ColorConstants.Foreground, Color.black); } doc.setLogicalStyle(offset, bp); }
/** Marks a line as current (e.g. for the debugger). * If the document has a defined style named {@link #CURRENT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ @Deprecated public static void markCurrent(StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle(CURRENT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle(CURRENT_STYLE_NAME, null); if (bp == null) { return; } bp.addAttribute(StyleConstants.ColorConstants.Background, Color.blue); bp.addAttribute(StyleConstants.ColorConstants.Foreground, Color.white); } doc.setLogicalStyle(offset, bp); }
/** Marks a line as current (e.g. for the debugger). * If the document has a defined style named {@link #CURRENT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markCurrent (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (CURRENT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (CURRENT_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.blue ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.white ); } doc.setLogicalStyle (offset, bp); }
/** Attach a breakpoint to a line in the document. * If the document has a defined style named {@link #BREAKPOINT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to set breakpoint to * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markBreakpoint (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (BREAKPOINT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (BREAKPOINT_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.red ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.white ); } doc.setLogicalStyle (offset, bp); }
/** Mark a line as erroneous (e.g. by the compiler). * If the document has a defined style named {@link #ERROR_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markError (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (ERROR_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (ERROR_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.green ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.black ); } doc.setLogicalStyle (offset, bp); }
/** Attach a breakpoint to a line in the document. * If the document has a defined style named {@link #BREAKPOINT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to set breakpoint to * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markBreakpoint (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (BREAKPOINT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (BREAKPOINT_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.red ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.white ); } doc.setLogicalStyle (offset, bp); }
/** Mark a line as erroneous (e.g. by the compiler). * If the document has a defined style named {@link #ERROR_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markError (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (ERROR_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (ERROR_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.green ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.black ); } doc.setLogicalStyle (offset, bp); }
/** Marks a line as current (e.g. for the debugger). * If the document has a defined style named {@link #CURRENT_STYLE_NAME}, it is used. * Otherwise, a new style is defined. * * @param doc the document * @param offset identifies the line to mark * @exception NullPointerException If the <code>doc</code> parameter * is <code>null</code>. * * @deprecated since 1.20. Use addAnnotation() instead */ public static void markCurrent (StyledDocument doc, int offset) { checkDocParameter(doc); Style bp = doc.getStyle (CURRENT_STYLE_NAME); if (bp == null) { // create the style bp = doc.addStyle (CURRENT_STYLE_NAME, null); if (bp == null) return; bp.addAttribute ( StyleConstants.ColorConstants.Background, Color.blue ); bp.addAttribute ( StyleConstants.ColorConstants.Foreground, Color.white ); } doc.setLogicalStyle (offset, bp); }
StyleConstants.setItalic(regular, false); doc.setLogicalStyle(0, regular);