Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Implements | |
Package | com.apple.cocoa.application |
Companion guide |
An NSTextTab represents a tab in an NSParagraphStyle object, storing an alignment type and location. NSTextTabs are most frequently used with the Application Kit’s text system and with NSRulerView and NSRulerMarker objects. See the appropriate class specifications for more information on these uses.
The text system supports four alignment types: left, center, right, and decimal (based on the decimal separator character of the locale in effect). These alignment types are absolute, not based on the line sweep direction of text. For example, tabbed text is always positioned to the left of a right-aligned tab, whether the line sweep direction is left to right or right to left. A tab’s location, on the other hand, is relative to the back margin. A tab set at 1.5”, for example, is at 1.5” from the right in right to left text.
Creates an empty NSTextTab.
public NSTextTab
()
Creates an NSTextTab with an alignment of type at location on the paragraph.
public NSTextTab
(int type, float location)
The location is relative to the back margin, based on the line sweep direction of the paragraph. type can be any of the values described in “Constants.”
Creates an NSTextTab with the text alignment, location, and options.
public NSTextTab
(int alignment, float loc, NSDictionary options)
The text alignment is used to determine the position of text inside the tab column. See the “Constants” section for a mapping between alignments and tab stop types.
public int alignment
()
Returns the text alignment of the tab, as defined by the “Constants” of NSText.
Returns the receiver’s ruler location relative to the back margin.
public float location
()
Returns the dictionary of attributes associated with the tab.
public NSDictionary options
()
Returns the receiver’s tab stop type.
public int tabStopType
()
The possible values are listed in “Constants.”
These constants describe the various type of tab stops:
The following constant specifies the terminating character for a tab column:
The following mappings define the conversions between text alignment in NSTextTab and tab stop types defined by NSTextTab:
To tab stop type:
Alignment |
Tab Stop Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
From tab stop type:
Tab Stop Type |
Alignment |
---|---|
|
|
|
|
|
|
|
|
© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)