org.gnu.gtk
Class TextView

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gtk.GtkObject
          extended byorg.gnu.gtk.Widget
              extended byorg.gnu.gtk.Container
                  extended byorg.gnu.gtk.TextView

public class TextView
extends Container

Widget for displaying textual data.

Conceptual Overview

java-gnome has an extremely powerful framework for multiline text editing. The primary objects involved in the process are TextBuffer, which represents the text being edited, and TextView, a widget which can display a TextBuffer. Each buffer can be displayed by any number of views.

One of the important things to remember about text in java-gnome is that it's in the UTF-8 encoding. This means that one character can be encoded as multiple bytes. Character counts are usually referred to as offsets, while byte counts are called indexes. If you confuse these two, things will work fine with ASCII, but as soon as your buffer contains multibyte characters, bad things will happen.

Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things. A tag is represented by a TextTag object. One TextTag can be applied to any number of text ranges in any number of buffers.

Each tag is stored in a TextTagTable. A tag table defines a set of tags that can be used together. Each buffer has one tag table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between multiple buffers, however.

Tags can have names, which is convenient sometimes (for example, you can name your tag that makes things bold "bold"), but they can also be anonymous (which is convenient if you're creating tags on-the-fly).

Most text manipulation is accomplished with iterators, represented by a TextIter. An iterator represents a position between two characters in the text buffer. Iterators are not valid indefinitely; whenever the buffer is modified in a way that affects the number of characters in the buffer, all outstanding iterators become invalid. (Note that deleting 5 characters and then reinserting 5 still invalidates iterators, though you end up with the same number of characters you pass through a state with a different number).

Because of this, iterators can't be used to preserve positions across buffer modifications. To preserve a position, the TextMark object is ideal. You can think of a mark as an invisible cursor or insertion point; it floats in the buffer, saving a position. If the text surrounding the mark is deleted, the mark remains in the position the text once occupied; if text is inserted at the mark, the mark ends up either to the left or to the right of the new text, depending on its gravity. The standard text cursor in left-to-right languages is a mark with right gravity, because it stays to the right of inserted text.

Like tags, marks can be either named or anonymous. There are two marks built-in to TextBuffer; these are named "insert" and "selection_bound" and refer to the insertion point and the boundary of the selection which is not the insertion point, respectively. If no text is selected, these two marks will be in the same position. You can manipulate what is selected and where the cursor appears by moving these marks around.

Text buffers always contain at least one line, but may be empty (that is, buffers can contain zero characters). The last line in the text buffer never ends in a line separator (such as newline); the other lines in the buffer always end in a line separator. Line separators count as characters when computing character counts and character offsets. Note that some Unicode line separators are represented with multiple bytes in UTF-8, and the two-character sequence "\r\n" is also considered a line separator.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
TextView()
          Constructs a new TextView.
TextView(Handle handle)
          Construct a TextView from a handle to a native resource.
TextView(TextBuffer buffer)
          Creates a new TextView widget displaying the buffer buffer.
 
Method Summary
 void addChild(Widget child, TextChildAnchor anchor)
          Adds a child widget in the text buffer, at the given anchor.
 void addListener(TextViewListener listener)
          Register an object to receive text view event notification.
protected  void fireTextViewEvent(TextViewEvent event)
           
 boolean getAcceptsTab()
          Returns whether pressing the Tab key inserts a tab characters.
 TextBuffer getBuffer()
          Returns the buffer being used
 TextAttributes getDefaultAttributes()
          Obtains a copy of the default text attributes.
 boolean getEditable()
          Returns the default editability of the GtkTextView.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 Adjustment getHAdjustment()
           
protected static Handle getHAdjustment(Handle textView)
           
 boolean getOverwrite()
          Returns whether the TextView is in overwrite mode or not.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 Adjustment getVAdjustment()
           
protected static Handle getVAdjustment(Handle textView)
           
protected static void gtk_text_view_add_child_at_anchor(Handle textView, Handle child, Handle anchor)
           
protected static void gtk_text_view_add_child_in_window(Handle textView, Handle child, int whichWindow, int xpos, int ypos)
           
protected static boolean gtk_text_view_backward_display_line_start(Handle textView, Handle iter)
           
protected static boolean gtk_text_view_backward_display_line(Handle textView, Handle iter)
           
protected static void gtk_text_view_buffer_to_window_coords(Handle textView, int win, int bufferX, int bufferY, int[] windowX, int[] windowY)
           
protected static boolean gtk_text_view_forward_display_line_end(Handle textView, Handle iter)
           
protected static boolean gtk_text_view_forward_display_line(Handle textView, Handle iter)
           
protected static boolean gtk_text_view_get_accepts_tab(Handle textview)
           
protected static int gtk_text_view_get_border_window_size(Handle textView, int type)
           
protected static Handle gtk_text_view_get_buffer(Handle textView)
           
protected static boolean gtk_text_view_get_cursor_visible(Handle textView)
           
protected static Handle gtk_text_view_get_default_attributes(Handle textView)
           
protected static boolean gtk_text_view_get_editable(Handle textView)
           
protected static int gtk_text_view_get_indent(Handle textView)
           
protected static void gtk_text_view_get_iter_at_location(Handle textView, Handle iter, int x, int y)
           
protected static void gtk_text_view_get_iter_location(Handle textView, Handle iter, int location)
           
protected static int gtk_text_view_get_justification(Handle textView)
           
protected static int gtk_text_view_get_left_margin(Handle textView)
           
protected static void gtk_text_view_get_line_at_y(Handle textView, Handle targetIter, int y, int[] lneTop)
           
protected static void gtk_text_view_get_line_yrange(Handle textView, Handle iter, int[] y, int[] height)
           
protected static boolean gtk_text_view_get_overwrite(Handle view)
           
protected static int gtk_text_view_get_pixels_above_lines(Handle textView)
           
protected static int gtk_text_view_get_pixels_below_lines(Handle textView)
           
protected static int gtk_text_view_get_pixels_inside_wrap(Handle textView)
           
protected static int gtk_text_view_get_right_margin(Handle textView)
           
protected static Handle gtk_text_view_get_tabs(Handle textView)
           
protected static int gtk_text_view_get_type()
           
protected static void gtk_text_view_get_visible_rect(Handle textView, Handle visibleRect)
           
protected static int gtk_text_view_get_window_type(Handle textView, Handle window)
           
protected static Handle gtk_text_view_get_window(Handle textView, int win)
           
protected static int gtk_text_view_get_wrap_mode(Handle textView)
           
protected static void gtk_text_view_move_child(Handle textView, Handle child, int xpos, int ypos)
           
protected static boolean gtk_text_view_move_mark_onscreen(Handle textView, Handle mark)
           
protected static boolean gtk_text_view_move_visually(Handle textView, Handle iter, int count)
           
protected static Handle gtk_text_view_new_with_buffer(Handle buffer)
           
protected static Handle gtk_text_view_new()
           
protected static boolean gtk_text_view_place_cursor_onscreen(Handle textView)
           
protected static void gtk_text_view_scroll_mark_onscreen(Handle textView, Handle mark)
           
protected static boolean gtk_text_view_scroll_to_iter(Handle textView, Handle iter, double withinMargin, boolean useAlign, double xalign, double yalign)
           
protected static void gtk_text_view_scroll_to_mark(Handle textView, Handle mark, double withinMargin, boolean useAlign, double xalign, double yalign)
           
protected static void gtk_text_view_set_accepts_tab(Handle view, boolean setting)
           
protected static void gtk_text_view_set_border_window_size(Handle textView, int type, int size)
           
protected static void gtk_text_view_set_buffer(Handle textView, Handle buffer)
           
protected static void gtk_text_view_set_cursor_visible(Handle textView, boolean setting)
           
protected static void gtk_text_view_set_editable(Handle textView, boolean setting)
           
protected static void gtk_text_view_set_indent(Handle textView, int indent)
           
protected static void gtk_text_view_set_justification(Handle textView, int justification)
           
protected static void gtk_text_view_set_left_margin(Handle textView, int leftMargin)
           
protected static void gtk_text_view_set_overwrite(Handle view, boolean setting)
           
protected static void gtk_text_view_set_pixels_above_lines(Handle textView, int pixelsAboveLines)
           
protected static void gtk_text_view_set_pixels_below_lines(Handle textView, int pixelsBelowLines)
           
protected static void gtk_text_view_set_pixels_inside_wrap(Handle textView, int pixelsInsideWrap)
           
protected static void gtk_text_view_set_right_margin(Handle textView, int rightMargin)
           
protected static void gtk_text_view_set_tabs(Handle textView, Handle tabs)
           
protected static void gtk_text_view_set_wrap_mode(Handle textView, int wrapMode)
           
protected static boolean gtk_text_view_starts_display_line(Handle textView, Handle iter)
           
protected static void gtk_text_view_window_to_buffer_coords(Handle textView, int win, int windowX, int windowY, int[] bufferX, int[] bufferY)
           
 boolean moveCursorOnScreen()
          Moves the cursor to the currently visible region of the buffer, it it isn't there already.
 void removeListener(TextViewListener listener)
          Unregister an object that was receiving text view event notification.
 boolean scrollToIter(TextIter iter, double withinMargin)
          Scrolls text view so that iter is on the screen.
 boolean scrollToIter(TextIter iter, double withinMargin, double xAlign, double yAlign)
          Scrolls text view so that iter is on the screen in the position indicated by xalign and yalign.
 void scrollToMark(TextMark mark, double withinMargin)
          Scrolls the view so that mark is on the screen.
 void scrollToMark(TextMark mark, double withinMargin, boolean useAlign, double xAlign, double yAlign)
          Scrolls the view so that mark is on the screen in the position indicated by xAlign and yAlign.
 void setAcceptsTab(boolean acceptsTab)
          Sets the behavior of the text widget when the Tab key is pressed.
 void setBuffer(TextBuffer buffer)
          Sets buffer as the buffer being displayed by the view.
 void setCursorVisible(boolean setting)
          Toggles whether the insertion point is displayed.
 void setEditable(boolean setting)
          Sets the default editability of the GtkTextView.
 void setIndent(int indent)
          Sets the default indentation for paragraphs in text_view.
 void setJustification(Justification justification)
          Sets the default justification of text in text_view.
 void setLeftMargin(int leftMargin)
          Sets the default left margin for text in text_view.
 void setOverwrite(boolean overwrite)
          Changes the overwrite mode (whether text is overwritten)
 void setPixelsAboveLines(int pixelsAboveLines)
          Sets the default number of blank pixels above paragraphs in text_view.
 void setPixelsBelowLine(int pixelsBelowLines)
          Sets the default number of pixels of blank space to put below paragraphs in text_view.
 void setPixelsInsideWrap(int pixelsInsideWrap)
          Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
 void setRightMargin(int rightMargin)
          Sets the default right margin for text in text_view.
 void setTabs(TabArray tabStops)
          Sets the default tab stops for paragraphs in text_view.
 void setWrapMode(WrapMode wrapMode)
          Sets the line wrapping for the view.
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, fireContainerEvent, getBorderWidth, getChildren, getResizeMode, gtk_container_add, gtk_container_check_resize, gtk_container_child_type, gtk_container_get_border_width, gtk_container_get_children, gtk_container_get_focus_chain, gtk_container_get_focus_hadjustment, gtk_container_get_focus_vadjustment, gtk_container_get_resize_mode, gtk_container_get_type, gtk_container_propagate_expose, gtk_container_remove, gtk_container_resize_children, gtk_container_set_border_width, gtk_container_set_focus_chain, gtk_container_set_focus_child, gtk_container_set_focus_hadjustment, gtk_container_set_focus_vadjustment, gtk_container_set_reallocate_redraws, gtk_container_set_resize_mode, gtk_container_unset_focus_chain, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, destroy, draw, drawArea, drawArea, findListener, finish, fireBooleanLifeCycleEvent, fireDragDestinationEvent, fireDragSourceEvent, fireExposeEvent, fireFocusEvent, fireKeyEvent, fireLifeCycleEvent, fireMouseEvent, fireMouseMotionEvent, getAccessible, getColormap, getContext, getData, getDisplay, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWindow, grabDefault, grabFocus, gtk_drag_dest_set, gtk_drag_dest_unset, gtk_drag_finish, gtk_drag_get_data, gtk_drag_highlight, gtk_drag_source_set_icon_pixbuf, gtk_drag_source_set_icon_stock, gtk_drag_source_set_icon, gtk_drag_source_set, gtk_drag_source_unset, gtk_drag_unhighlight, gtk_widget_activate, gtk_widget_add_accelerator, gtk_widget_add_events, gtk_widget_add_mnemonic_label, gtk_widget_can_activate_accel, gtk_widget_child_focus, gtk_widget_child_notify, gtk_widget_class_path, gtk_widget_create_pango_context, gtk_widget_create_pango_layout, gtk_widget_destroy, gtk_widget_destroyed, gtk_widget_ensure_style, gtk_widget_event, gtk_widget_freeze_child_notify, gtk_widget_get_accessible, gtk_widget_get_ancestor, gtk_widget_get_child_requisition, gtk_widget_get_child_visible, gtk_widget_get_colormap, gtk_widget_get_composite_name, gtk_widget_get_default_colormap, gtk_widget_get_default_direction, gtk_widget_get_default_style, gtk_widget_get_default_visual, gtk_widget_get_direction, gtk_widget_get_display, gtk_widget_get_events, gtk_widget_get_extension_events, gtk_widget_get_modifier_style, gtk_widget_get_name, gtk_widget_get_pango_context, gtk_widget_get_parent_window, gtk_widget_get_parent, gtk_widget_get_pointer, gtk_widget_get_root_window, gtk_widget_get_screen, gtk_widget_get_sensitive, gtk_widget_get_settings, gtk_widget_get_size_request, gtk_widget_get_style, gtk_widget_get_toplevel, gtk_widget_get_type, gtk_widget_get_visual, gtk_widget_get_window, gtk_widget_grab_default, gtk_widget_grab_focus, gtk_widget_has_screen, gtk_widget_hide_all, gtk_widget_hide_on_delete, gtk_widget_hide, gtk_widget_intersect, gtk_widget_is_ancestor, gtk_widget_is_focus, gtk_widget_list_accel_closures, gtk_widget_list_mnemonic_labels, gtk_widget_map, gtk_widget_mnemonic_activate, gtk_widget_modify_base, gtk_widget_modify_bg, gtk_widget_modify_fg, gtk_widget_modify_font, gtk_widget_modify_style, gtk_widget_modify_text, gtk_widget_path, gtk_widget_pop_colormap, gtk_widget_pop_composite_child, gtk_widget_push_colormap, gtk_widget_push_composite_child, gtk_widget_queue_draw_area, gtk_widget_queue_draw, gtk_widget_queue_resize, gtk_widget_realize, gtk_widget_ref, gtk_widget_region_intersect, gtk_widget_remove_accelerator, gtk_widget_remove_mnemonic_label, gtk_widget_render_icon, gtk_widget_reparent, gtk_widget_reset_rc_styles, gtk_widget_send_expose, gtk_widget_set_accel_path, gtk_widget_set_app_paintable, gtk_widget_set_child_visible, gtk_widget_set_colormap, gtk_widget_set_composite_name, gtk_widget_set_default_colormap, gtk_widget_set_default_direction, gtk_widget_set_direction, gtk_widget_set_double_buffered, gtk_widget_set_events, gtk_widget_set_extension_events, gtk_widget_set_name, gtk_widget_set_parent_window, gtk_widget_set_parent, gtk_widget_set_redraw_on_allocate, gtk_widget_set_scroll_adjustments, gtk_widget_set_sensitive, gtk_widget_set_size_request, gtk_widget_set_state, gtk_widget_set_style, gtk_widget_shape_combine_mask, gtk_widget_show_all, gtk_widget_show_now, gtk_widget_show, gtk_widget_size_allocate, gtk_widget_size_request, gtk_widget_style_get_property, gtk_widget_thaw_child_notify, gtk_widget_translate_coordinates, gtk_widget_unmap, gtk_widget_unparent, gtk_widget_unrealize, gtk_widget_unref, handleButtonPressed, handleButtonReleased, handleDelete, handleDragDataGet, handleDragDestination, handleExpose, handleFocusIn, handleFocusOut, handleHide, handleKeyPressed, handleKeyReleased, handleMap, handleMouseEnter, handleMouseLeave, handleMouseMotion, handleNoExpose, handleRealize, handleScroll, handleShow, handleUnmap, hasFocus, hasScreen, hide, hideAll, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
getFlags, gtk_object_destroy, gtk_object_get_type, gtk_object_sink, setFlags, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextView

public TextView()
Constructs a new TextView. If you don't specify a buffer before using it, a default one will be created for you.


TextView

public TextView(TextBuffer buffer)
Creates a new TextView widget displaying the buffer buffer. One buffer can be shared among many widgets.

Parameters:
buffer - Buffer to use

TextView

public TextView(Handle handle)
Construct a TextView from a handle to a native resource.

Method Detail

setBuffer

public void setBuffer(TextBuffer buffer)
Sets buffer as the buffer being displayed by the view.

Parameters:
buffer - The new buffer to display

getBuffer

public TextBuffer getBuffer()
Returns the buffer being used

Returns:
The buffer used in the widget.

scrollToMark

public void scrollToMark(TextMark mark,
                         double withinMargin,
                         boolean useAlign,
                         double xAlign,
                         double yAlign)
Scrolls the view so that mark is on the screen in the position indicated by xAlign and yAlign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center.

Parameters:
mark - A TextMark
withinMargin - Margin as a fraction of screen size
useAlign - Whether to use alignment arguments.
xAlign - Horizontal alignment of mark within visible area.
yAlign - : vertical alignment of mark within visible area

scrollToMark

public void scrollToMark(TextMark mark,
                         double withinMargin)
Scrolls the view so that mark is on the screen. The text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size withinMargin.

Parameters:
mark - A TextMark
withinMargin - Margin as a fraction of screen size

scrollToIter

public boolean scrollToIter(TextIter iter,
                            double withinMargin,
                            double xAlign,
                            double yAlign)
Scrolls text view so that iter is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. The effective screen for purposes of this function is reduced by a margin of size within_margin. NOTE: This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.

Parameters:
iter - a TextIter
withinMargin - Margin as a [0.0,0.5) fraction of screen size.
xAlign - : horizontal alignment of mark within visible area.
yAlign - : vertical alignment of mark within visible area
Returns:
TRUE if scrolling occurred

scrollToIter

public boolean scrollToIter(TextIter iter,
                            double withinMargin)
Scrolls text view so that iter is on the screen. The effective screen for purposes of this function is reduced by a margin of size within_margin. NOTE: This function uses the currently-computed height of the lines in the text buffer. Note that line heights are computed in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid oddness, consider using gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.

Parameters:
iter - a TextIter
withinMargin - Margin as a [0.0,0.5) fraction of screen size.
Returns:
TRUE if scrolling occurred

moveCursorOnScreen

public boolean moveCursorOnScreen()
Moves the cursor to the currently visible region of the buffer, it it isn't there already.

Returns:
TRUE if the cursor had to be moved.

addChild

public void addChild(Widget child,
                     TextChildAnchor anchor)
Adds a child widget in the text buffer, at the given anchor.

Parameters:
child - A Widget
anchor - A TextChildAnchor in the TextBuffer for his view

setWrapMode

public void setWrapMode(WrapMode wrapMode)
Sets the line wrapping for the view.

Parameters:
wrapMode - A WrapMode

setEditable

public void setEditable(boolean setting)
Sets the default editability of the GtkTextView. You can override this default setting with tags in the buffer, using the "editable" attribute of tags.

Parameters:
setting - Whether it's editable

getEditable

public boolean getEditable()
Returns the default editability of the GtkTextView. Tags in the buffer may override this setting for some ranges of text.

Returns:
true if the widget is editable.

setCursorVisible

public void setCursorVisible(boolean setting)
Toggles whether the insertion point is displayed. A buffer with no editable text probably shouldn't have a visible cursor, so you may want to turn the cursor off.

Parameters:
setting - Whether to show the insertion cursor

setPixelsAboveLines

public void setPixelsAboveLines(int pixelsAboveLines)
Sets the default number of blank pixels above paragraphs in text_view. Tags in the buffer for text_view may override the defaults.

Parameters:
pixelsAboveLines - Pixels above paragraphs

setPixelsBelowLine

public void setPixelsBelowLine(int pixelsBelowLines)
Sets the default number of pixels of blank space to put below paragraphs in text_view. May be overridden by tags applied to text_view's buffer.

Parameters:
pixelsBelowLines - Pixels below paragraphs

setPixelsInsideWrap

public void setPixelsInsideWrap(int pixelsInsideWrap)
Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph. May be overridden by tags in text_view's buffer.

Parameters:
pixelsInsideWrap - Default number of pixels between wrapped lines

setJustification

public void setJustification(Justification justification)
Sets the default justification of text in text_view. Tags in the view's buffer may override the default.

Parameters:
justification - The justification to use.

setLeftMargin

public void setLeftMargin(int leftMargin)
Sets the default left margin for text in text_view. Tags in the buffer may override the default.

Parameters:
leftMargin - Size of left margin, in pixels

setRightMargin

public void setRightMargin(int rightMargin)
Sets the default right margin for text in text_view. Tags in the buffer may override the default.

Parameters:
rightMargin - Size of right margin, in pixels

setIndent

public void setIndent(int indent)
Sets the default indentation for paragraphs in text_view. Tags in the buffer may override the default.

Parameters:
indent - Indentation in pixels

setTabs

public void setTabs(TabArray tabStops)
Sets the default tab stops for paragraphs in text_view. Tags in the buffer may override the default.

Parameters:
tabStops - tabs as a PangoTabArray

getDefaultAttributes

public TextAttributes getDefaultAttributes()
Obtains a copy of the default text attributes. These are the attributes used for text unless a tag overrides them.

Returns:
The text attributes being used

setAcceptsTab

public void setAcceptsTab(boolean acceptsTab)
Sets the behavior of the text widget when the Tab key is pressed. If TRUE, a tab character is inserted. If is FALSE, the keyboard focus is moved to the next widget in the focus chain.

Parameters:
acceptsTab - TRUE if pressing the Tab key should insert a tab character, FALSE, if pressing the Tab key should move the keyboard focus
Since:
2.4

getAcceptsTab

public boolean getAcceptsTab()
Returns whether pressing the Tab key inserts a tab characters.

Since:
2.4
See Also:
setAcceptsTab(boolean)

setOverwrite

public void setOverwrite(boolean overwrite)
Changes the overwrite mode (whether text is overwritten)

Parameters:
overwrite - TRUE to turn on overwrite mode, FALSE to turn it off
Since:
2.4

getOverwrite

public boolean getOverwrite()
Returns whether the TextView is in overwrite mode or not.

Since:
2.4
See Also:
setOverwrite(boolean)

getHAdjustment

public Adjustment getHAdjustment()

getVAdjustment

public Adjustment getVAdjustment()

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class Container

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Container

addListener

public void addListener(TextViewListener listener)
Register an object to receive text view event notification.

Parameters:
listener - The object that has implemented the TextViewListener interface that is to receive the text view events.

removeListener

public void removeListener(TextViewListener listener)
Unregister an object that was receiving text view event notification.

Parameters:
listener - The object that is to no longer receive text view events.

fireTextViewEvent

protected void fireTextViewEvent(TextViewEvent event)

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.


getHAdjustment

protected static final Handle getHAdjustment(Handle textView)

getVAdjustment

protected static final Handle getVAdjustment(Handle textView)

gtk_text_view_get_type

protected static final int gtk_text_view_get_type()

gtk_text_view_new

protected static final Handle gtk_text_view_new()

gtk_text_view_new_with_buffer

protected static final Handle gtk_text_view_new_with_buffer(Handle buffer)

gtk_text_view_set_buffer

protected static final void gtk_text_view_set_buffer(Handle textView,
                                                     Handle buffer)

gtk_text_view_get_buffer

protected static final Handle gtk_text_view_get_buffer(Handle textView)

gtk_text_view_scroll_to_iter

protected static final boolean gtk_text_view_scroll_to_iter(Handle textView,
                                                            Handle iter,
                                                            double withinMargin,
                                                            boolean useAlign,
                                                            double xalign,
                                                            double yalign)

gtk_text_view_scroll_to_mark

protected static final void gtk_text_view_scroll_to_mark(Handle textView,
                                                         Handle mark,
                                                         double withinMargin,
                                                         boolean useAlign,
                                                         double xalign,
                                                         double yalign)

gtk_text_view_scroll_mark_onscreen

protected static final void gtk_text_view_scroll_mark_onscreen(Handle textView,
                                                               Handle mark)

gtk_text_view_move_mark_onscreen

protected static final boolean gtk_text_view_move_mark_onscreen(Handle textView,
                                                                Handle mark)

gtk_text_view_place_cursor_onscreen

protected static final boolean gtk_text_view_place_cursor_onscreen(Handle textView)

gtk_text_view_get_visible_rect

protected static final void gtk_text_view_get_visible_rect(Handle textView,
                                                           Handle visibleRect)

gtk_text_view_set_cursor_visible

protected static final void gtk_text_view_set_cursor_visible(Handle textView,
                                                             boolean setting)

gtk_text_view_get_cursor_visible

protected static final boolean gtk_text_view_get_cursor_visible(Handle textView)

gtk_text_view_get_iter_location

protected static final void gtk_text_view_get_iter_location(Handle textView,
                                                            Handle iter,
                                                            int location)

gtk_text_view_get_iter_at_location

protected static final void gtk_text_view_get_iter_at_location(Handle textView,
                                                               Handle iter,
                                                               int x,
                                                               int y)

gtk_text_view_get_line_yrange

protected static final void gtk_text_view_get_line_yrange(Handle textView,
                                                          Handle iter,
                                                          int[] y,
                                                          int[] height)

gtk_text_view_get_line_at_y

protected static final void gtk_text_view_get_line_at_y(Handle textView,
                                                        Handle targetIter,
                                                        int y,
                                                        int[] lneTop)

gtk_text_view_buffer_to_window_coords

protected static final void gtk_text_view_buffer_to_window_coords(Handle textView,
                                                                  int win,
                                                                  int bufferX,
                                                                  int bufferY,
                                                                  int[] windowX,
                                                                  int[] windowY)

gtk_text_view_window_to_buffer_coords

protected static final void gtk_text_view_window_to_buffer_coords(Handle textView,
                                                                  int win,
                                                                  int windowX,
                                                                  int windowY,
                                                                  int[] bufferX,
                                                                  int[] bufferY)

gtk_text_view_get_window

protected static final Handle gtk_text_view_get_window(Handle textView,
                                                       int win)

gtk_text_view_get_window_type

protected static final int gtk_text_view_get_window_type(Handle textView,
                                                         Handle window)

gtk_text_view_set_border_window_size

protected static final void gtk_text_view_set_border_window_size(Handle textView,
                                                                 int type,
                                                                 int size)

gtk_text_view_get_border_window_size

protected static final int gtk_text_view_get_border_window_size(Handle textView,
                                                                int type)

gtk_text_view_forward_display_line

protected static final boolean gtk_text_view_forward_display_line(Handle textView,
                                                                  Handle iter)

gtk_text_view_backward_display_line

protected static final boolean gtk_text_view_backward_display_line(Handle textView,
                                                                   Handle iter)

gtk_text_view_forward_display_line_end

protected static final boolean gtk_text_view_forward_display_line_end(Handle textView,
                                                                      Handle iter)

gtk_text_view_backward_display_line_start

protected static final boolean gtk_text_view_backward_display_line_start(Handle textView,
                                                                         Handle iter)

gtk_text_view_starts_display_line

protected static final boolean gtk_text_view_starts_display_line(Handle textView,
                                                                 Handle iter)

gtk_text_view_move_visually

protected static final boolean gtk_text_view_move_visually(Handle textView,
                                                           Handle iter,
                                                           int count)

gtk_text_view_add_child_at_anchor

protected static final void gtk_text_view_add_child_at_anchor(Handle textView,
                                                              Handle child,
                                                              Handle anchor)

gtk_text_view_add_child_in_window

protected static final void gtk_text_view_add_child_in_window(Handle textView,
                                                              Handle child,
                                                              int whichWindow,
                                                              int xpos,
                                                              int ypos)

gtk_text_view_move_child

protected static final void gtk_text_view_move_child(Handle textView,
                                                     Handle child,
                                                     int xpos,
                                                     int ypos)

gtk_text_view_set_wrap_mode

protected static final void gtk_text_view_set_wrap_mode(Handle textView,
                                                        int wrapMode)

gtk_text_view_get_wrap_mode

protected static final int gtk_text_view_get_wrap_mode(Handle textView)

gtk_text_view_set_editable

protected static final void gtk_text_view_set_editable(Handle textView,
                                                       boolean setting)

gtk_text_view_get_editable

protected static final boolean gtk_text_view_get_editable(Handle textView)

gtk_text_view_set_pixels_above_lines

protected static final void gtk_text_view_set_pixels_above_lines(Handle textView,
                                                                 int pixelsAboveLines)

gtk_text_view_get_pixels_above_lines

protected static final int gtk_text_view_get_pixels_above_lines(Handle textView)

gtk_text_view_set_pixels_below_lines

protected static final void gtk_text_view_set_pixels_below_lines(Handle textView,
                                                                 int pixelsBelowLines)

gtk_text_view_get_pixels_below_lines

protected static final int gtk_text_view_get_pixels_below_lines(Handle textView)

gtk_text_view_set_pixels_inside_wrap

protected static final void gtk_text_view_set_pixels_inside_wrap(Handle textView,
                                                                 int pixelsInsideWrap)

gtk_text_view_get_pixels_inside_wrap

protected static final int gtk_text_view_get_pixels_inside_wrap(Handle textView)

gtk_text_view_set_justification

protected static final void gtk_text_view_set_justification(Handle textView,
                                                            int justification)

gtk_text_view_get_justification

protected static final int gtk_text_view_get_justification(Handle textView)

gtk_text_view_set_left_margin

protected static final void gtk_text_view_set_left_margin(Handle textView,
                                                          int leftMargin)

gtk_text_view_get_left_margin

protected static final int gtk_text_view_get_left_margin(Handle textView)

gtk_text_view_set_right_margin

protected static final void gtk_text_view_set_right_margin(Handle textView,
                                                           int rightMargin)

gtk_text_view_get_right_margin

protected static final int gtk_text_view_get_right_margin(Handle textView)

gtk_text_view_set_indent

protected static final void gtk_text_view_set_indent(Handle textView,
                                                     int indent)

gtk_text_view_get_indent

protected static final int gtk_text_view_get_indent(Handle textView)

gtk_text_view_set_tabs

protected static final void gtk_text_view_set_tabs(Handle textView,
                                                   Handle tabs)

gtk_text_view_get_tabs

protected static final Handle gtk_text_view_get_tabs(Handle textView)

gtk_text_view_get_default_attributes

protected static final Handle gtk_text_view_get_default_attributes(Handle textView)

gtk_text_view_set_accepts_tab

protected static final void gtk_text_view_set_accepts_tab(Handle view,
                                                          boolean setting)

gtk_text_view_get_accepts_tab

protected static final boolean gtk_text_view_get_accepts_tab(Handle textview)

gtk_text_view_set_overwrite

protected static final void gtk_text_view_set_overwrite(Handle view,
                                                        boolean setting)

gtk_text_view_get_overwrite

protected static final boolean gtk_text_view_get_overwrite(Handle view)