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

NIOpenPanel



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



Class Description

NIOpenPanel is used to allow a user to open an item in a NetInfo domain, such as a user account or host entry. The panel's upper half contains a browser for selecting a NetInfo domain; its lower half contains a browser for selecting a specific item within the domain (a NetInfo directory).  Each half has a text field containing a title and an editable text field representing the path of the domain in the upper half and the name of the item in the lower half.



Instance Variables

id directoryObjectBrowser;

char *pathToUse;

ni_entrylist *filler;

id listTitleField;

id panelTitleField;

id selectedItemText;

id iconButton;


directoryObjectBrowser Browser object for lower half of the open panel.
pathToUse Stores domain path to use when loading domain browser in top half of panel.
filler Data for browser in lower half of panel.
listTitleField Field displayed above browser in lower half of panel.
panelTitleField Field displayed at top of panel.
selectedItemText Text field at bottom of lower browser.
iconButton Icon to display in top left corner of panel.



Method Types

Initializing and running a panel + new
runModal
Getting data from the panel directory
panelSizeDefaultName
Manipulating the panel setDirectoryPath:
setListTitle:
setPanelTitle:
refreshLowerData:
Searching searchItemList:
searchTextField
Filling the browser browser:fillMatrix:inColumn:
browser:loadCell:atRow:inColumn:
Text-related methods text:isEmpty:
textWillChange:
completeItemName
completeDomain
Target and action methods cellWasHitInBrowser:
cellWasHitInItemList:



Class Methods

new
+ new

Creates, if necessary, and returns a new instance of NIOpenPanel.  Each application shares just one instance of NIOpenPanel; this method returns the shared instance if it exists.



Instance Methods

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

Sent automatically 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.



cellWasHitInBrowser:
cellWasHitInBrowser:(id)sender

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



cellWasHitInItemList:
cellWasHitInItemList:sender

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



completeDomain
completeDomain

This method is invoked to complete the upper text field (and browser) 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.



completeItemName
completeItemName

Reserved for future use.



directory
(const char *)directory

Returns the name of the directory that's selected in the lower browser, or NULL if no valid directory is selected.



panelSizeDefaultName
(const char *)panelSizeDefaultName

Returns the name of a constant representing the size of the panel. Used in conjunction with the inherited method resizePanelBeforeShowing:.



refreshLowerData:
refreshLowerData:sender

Reloads and redraws browser in lower half of panel.  Returns self.



runModal
(int)runModal

Displays the panel and begins its event loop.  Returns the exit flags from the panel.



searchItemList:
searchItemList:textThing

Sent automatically to keep the lower browser in sync with what a user types into the lower text field. Don't invoke this method directly.  Returns self.



searchTextField
searchTextField

Sent automatically to update the lower browser after the user has finished entering text into the lower text field.  Don't invoke this method directly.  Returns self.



setDirectoryPath:
setDirectoryPath:(const char *)path

Use this method to set the initial directory path in the lower browser.  The contents of the indicated directory will be displayed when the browser is loaded.  Returns self.



setListTitle:
setListTitle:(const char *)title

Use this method to set the title of the lower half of the panel.  Returns self.



setPanelTitle:
setPanelTitle:(const char *)title

Use this method to set the title of the panel.  Returns self.



text:isEmpty:
text:textObj isEmpty:(BOOL)flag

This Text delegate method is invoked when the user types in either text field.  It disables the OK button if the text field is empty; otherwise, it enables the OK button.



textWillChange:
(BOOL)textWillChange:textObject

This Text delegate method is invoked when exiting a text field after an edit has been made.