Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

NIDomainPanel



Inherits From: Object
Declared In: nikit/NIDomainPanel.h



Class Description

NIDomainPanel provides a mechanism for selecting a specific domain in the NetInfo domain hierarchy.  The panel includes a browser for the domain hierarchy and a text field at the bottom for entering the path to a domain. An example of this object is the Open Domain panel used in NetInfoManager.



Instance Variables

id domainBrowser;

id okButton;

id cancelButton;

id domainText;

id panel;

id groupForm;

id fieldEditor;

id sharedDomainPanel;

struct NIHierarchyOfDomains myDomains;

ni_status lastFailure;

int exitFlags;

char returnPath[1024];

void *currentDomain;

BOOL domainBrowserLoaded;

id panelButton;

NXZone *zone;


domainBrowser Object to browse NetInfo domains.
okButton The OK button.
cancelButton The Cancel button.
domainText Unused.
panel The panel object.
groupForm The text field.
fieldEditor The editing object for the text field.
sharedDomainPanel Unused.
myDomains The domain hierarchy.
lastFailure The last error condition from a NetInfo call.
exitFlags Indicates whether the user chose Cancel or OK.
returnPath Path of domain entered in the text field.
currentDomain Unused.
domainBrowserLoaded Indicates if a domain has been loaded into the browser.
panelButton The icon at the top left of the panel.
zone A memory allocation zone.



Method Types

Allocating and initializing an NIDomainPanel object
+ new
+ allocWithoutPanelFromZone:
init
Displaying the panel runModal
resizePanelBeforeShowing:
panel
windowDidResize:
Getting data exitFlags
domain
panelSizeDefaultName
Filling the browser loadDomainBrowser
loadDomainBrowserFrom:
browser:fillMatrix:inColumn:
browser:loadCell:atRow:inColumn:
freeLastColumn
fillNextColumn
Text-related methods completeDomain
runOk:
text:isEmpty:
textWillChange:
textWillEnd:
Target and action methods cellWasHitInBrowser:
cancel:
ok:



Class Methods

allocWithoutPanelFromZone:
+ allocWithoutPanelFromZone:(NXZone *)zone

Returns a new NIDomainPanel object without the panel. For use with a different panel layout. Use with init.



initialize
+ initialize

Initializes the NetInfo Kit zone; sent by the run-time system.  Don't invoke or override this method.



new
+ new

Returns the single NIDomainPanel instance per application. If one doesn't exist, it is created.



Instance Methods

browser:fillMatrix:inColumn:
(int)browser:sender fillMatrix:matrix inColumn:(int)column

Sent automatically by the browser when a column needs updating, this NXBrowser delegate method fills the indicated browser column with data.



browser:loadCell:atRow:inColumn:
browser:sender loadCell:cell atRow:(int)row inColumn:(int)column

Sent automatically by the browser, this NXBrowser delegate method fills the indicated cell with data.



cancel:
cancel:sender

This method is invoked when the Cancel button is clicked.  Returns self.



cellWasHitInBrowser:
cellWasHitInBrowser:(id)sender

This method is invoked when the user clicks in the browser.  Returns self.



completeDomain
completeDomain

This method is invoked to complete the text field when the user presses the Esc key, when the OK button is pressed, or when the current selection moves out of the text field.  Returns self if the path was successfully completed; otherwise, returns nil.



domain
(const char *)domain

Returns the name of the domain selected in the panel, or a localized string that indicates that the path was invalid.



exitFlags
(int)exitFlags

Returns the exit flags from the panel, indicating whether the user chose OK or Cancel.



fillNextColumn
fillNextColumn

Fills the next column of the domain hierarchy. Sent by browser:fillMatrix:inColumn:.  Returns self, or nil if an error occurred.



freeLastColumn
freeLastColumn

Clears the data in the rightmost column of the browser.  Returns self.



init
init

Initializes the NIDomainPanel object. For use with allocWithoutPanelFromZone:.  Returns self.



loadDomainBrowser
loadDomainBrowser

Loads the current domain information into the browser, filling to match the local domain.  Returns self, or nil if an error occurred.

See also:  loadDomainBrowserFrom:



loadDomainBrowserFrom:
loadDomainBrowserFrom:(const char *)aDomainName

Loads the browser with information from the named domain rather than the local domain.  Returns self, or nil if an error occurred.

See also:  loadDomainBrowser



ok:
ok:sender

This method is sent when the OK button is clicked.  Returns self.



panel
panel

Returns the Panel displayed by the NIDomainPanel.



panelSizeDefaultName
(const char *)panelSizeDefaultName

Returns the name of a constant indicating the panel's default size.

See also:  resizePanelBeforeShowing:



resizePanelBeforeShowing:
resizePanelBeforeShowing:(const char *)panelDefaultName

Resizes the panel to the size indicated by the constant identified with panelDefaultName, which can be obtained with the panelSizeDefaultName method. Resizes the panel to the larger of the user's last selection or the indicated panel minimum. Useful when changing languages, for example, because the minimum panel size may increase.  Returns nil if panelDefaultName is NULL; otherwise, returns self.

See also:  panelSizeDefaultName



runModal
(int)runModal

Displays the panel and begins its event loop.  Returns the exit flags from the panel, indicating whether the user chose OK or Cancel.



runOk:
runOk:sender

Sent automatically when Return is pressed or a browser item is double-clicked.  Returns self.



text:isEmpty:
text:textObject isEmpty:(BOOL)flag

Sent automatically when the text field is exited. This Text delegate method enables the OK button if any text is in the text field; otherwise, disables the OK button.  Returns self.



textWillChange:
textWillChange:textObject

Sent automatically when text is entered into the text field.  This Text delegate method sets the filtering function to be used for the field.  Returns zero.



textWillEnd:
(BOOL)textWillEnd: textObject

Sent automatically when user has finished editing the text field.  This Text delegate method completes the path in the text field, if possible.  It then returns NO if the text field contains a valid domain; otherwise, it returns YES.



windowDidResize:
windowDidResize:sender

Sent automatically when the user finishes resizing the panel.  This Window delegate method saves the panel's new size into the defaults system.