Set up the default control for this field (using default params).
@param targetScreen  Where to place this component (ie., Parent screen or GridBagLayout).
@return  Return the component or ScreenField that is created for this field.
346831
public ScreenComponent setupFieldView(ComponentParent targetScreen)
    {
        return this.setupDefaultView(targetScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), targetScreen, ScreenConstants.DISPLAY_DESC);
    }
910197
public void setupSFields()
    {
        super.setupSFields();
        this.getRecord(ProjectTaskScreenRecord.PROJECT_TASK_SCREEN_RECORD_FILE).getField(ProjectTaskScreenRecord.PROJECT_TASK_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
869595
public void setupSFields()
    {
        this.getRecord(ClassResource.CLASS_RESOURCE_FILE).getField(ClassResource.SEQUENCE_NO).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
        this.getRecord(ClassResource.CLASS_RESOURCE_FILE).getField(ClassResource.KEY_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
        this.getRecord(ClassResource.CLASS_RESOURCE_FILE).getField(ClassResource.VALUE_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
807797
public BasePanel getSubScreen(BasePanel parentScreen, ScreenLocation screenLocation, Map<String, Object> properties, int screenNo)
    {
        return null;        // Must override
    }
117889
public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, int iDisplayFieldSeq, boolean bIncludeBlankOption)
    {
        return this.setupTablePopup(itsLocation, targetScreen, this, iDisplayFieldDesc, record, DBConstants.MAIN_KEY_AREA, iDisplayFieldSeq, bIncludeBlankOption, false);
    }
234717
public ToolScreen addToolbars()
    {
        return new MaintToolbar(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null)
        {
            public void setupMiddleSFields()
            {
                new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON_WITH_GAP, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT);
                new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.RESET);
                String strDesc = UserPasswordChange.CHANGE_PASSWORD;
                String strCommand = Utility.addURLParam(null, DBParams.SCREEN, UserPasswordChange.class.getName());
                if (this.getProperty(DBParams.USER_NAME) == null)
                {
                    strDesc = UserEntryScreen.CREATE_NEW_USER;
                    strCommand = Utility.addURLParam(null, DBParams.SCREEN, UserEntryScreen.class.getName());
                }
                if (this.getTask() != null)
                    if (this.getTask().getApplication() != null)
                        strDesc = this.getTask().getApplication().getResources(ResourceConstants.MAIN_RESOURCE, true).getString(strDesc);
                new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST_BUTTON, ScreenConstants.DONT_SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, strDesc, MenuConstants.FORM, strCommand, MenuConstants.FORM + "Tip");
            }
        };
    }
954452
public JComponent createScreenComponent(Converter fieldInfo)
    {
        int iRows = 1;
        int iColumns = fieldInfo.getMaxLength();
        if (iColumns > 40)
        {
            iRows = 3;
            iColumns = 30;
        }
        String strDefault = fieldInfo.toString();
        if (strDefault == null)
            strDefault = Constants.BLANK;

        JComponent component = null;
        if (iRows <= 1)
        {
            component = new JTextField(strDefault, iColumns);
            if (fieldInfo instanceof FieldInfo)
                if (Number.class.isAssignableFrom(((FieldInfo)fieldInfo).getDataClass()))
                    ((JTextField)component).setHorizontalAlignment(JTextField.RIGHT);
        }
        else
        {
            component = new JTextArea(strDefault, iRows, iColumns);
            component.setBorder(m_borderLine);
        }
        return component;
    }
153009
public ScreenParent makeScreen(ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties)
    {
        ScreenParent screen = null;
        if ((iDocMode & ScreenConstants.DOC_MODE_MASK) == ScreenConstants.DETAIL_MODE)
            screen = Record.makeNewScreen(UserPermissionModel.USER_PERMISSION_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        else if ((iDocMode & ScreenConstants.DOC_MODE_MASK) == UserGroup.USER_INFO_DETAIL_SCREEN)
            screen = Record.makeNewScreen(UserInfoModel.USER_INFO_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        else if ((iDocMode & ScreenConstants.MAINT_MODE) == ScreenConstants.MAINT_MODE)
            screen = Record.makeNewScreen(USER_GROUP_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        else
            screen = Record.makeNewScreen(USER_GROUP_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        return screen;
    }
117949
public void addScreenButtons(Container parent)
    {
        GridBagLayout gridbag = (GridBagLayout)this.getScreenLayout();
        GridBagConstraints c = this.getGBConstraints();
        c.gridheight = GridBagConstraints.REMAINDER; // end row
        c.anchor = GridBagConstraints.NORTH;
        c.gridwidth = 1; // end column
        ImageIcon icon = BaseApplet.getSharedInstance().loadImageIcon(Constants.SUBMIT);
        JButton button = new JButton(Constants.SUBMIT, icon);
        button.setOpaque(false);
        button.setName(Constants.SUBMIT);
        gridbag.setConstraints(button, c);
        parent.add(button);
        button.addActionListener(this);
        c.gridx = 3;                            // Column 1
        c.gridheight = GridBagConstraints.REMAINDER; // end row
        c.anchor = GridBagConstraints.NORTH;
        icon = BaseApplet.getSharedInstance().loadImageIcon(Constants.RESET);
        button = new JButton(Constants.RESET, icon);
        button.setOpaque(false);
        button.setName(Constants.RESET);
        gridbag.setConstraints(button, c);
        parent.add(button);
        c.gridheight = 1; //Set back
        button.addActionListener(this);
    }
136924
public void init(ScreenLoc itsLocation, ComponentParent parentScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
    {
        this.init(null, null, null, null, null, null, false, null, null);
    }
412947
public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton)
    {
        String keyAreaName = null;
        if (iQueryKeySeq != -1)
            if (record != null) // Always
                keyAreaName = ((Record)record).getKeyArea(iQueryKeySeq).getKeyName();
        BaseField fldDisplayFieldDesc = null;
        if (iDisplayFieldDesc != -1)
            if (record != null) // Always
                fldDisplayFieldDesc = ((Record)record).getField(iDisplayFieldDesc);
        return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, record, keyAreaName, fldDisplayFieldDesc, bIncludeBlankOption, bIncludeFormButton);
    }
698200
public ScreenField getComponentAfter(ScreenField sfCurrent, int iSelectField)
    {
        ScreenField m_ChildFocused = (ScreenField)sfCurrent;
        if (m_ChildFocused == null)
            iSelectField = DBConstants.SELECT_FIRST_FIELD;
        ScreenField sField = null;
        ScreenField sPrevScreenField = null;
        ScreenField sNextScreenField = null;
        ScreenField sTargetScreenField = null;
        ScreenField sLastFocusTarget = null;
        ScreenField sFirstFocusTarget = null;
// Now survey the control to see which one is next
        for (int iSField = 0; iSField < this.getSFieldCount(); iSField++)
        {   // This should only be called for Imaged GridScreens (Child windows would be deleted by now if Component)
            sField = this.getSField(iSField);
            if (sField.isEnabled()) if (sField.isFocusTarget())
            {
                if (sFirstFocusTarget == null)
                    sFirstFocusTarget = sField;
                sLastFocusTarget = sField;
                if (sTargetScreenField != null) if (sNextScreenField == null)
                    sNextScreenField = sField;
                if (sField == m_ChildFocused)
                    sTargetScreenField = sField;
                if (sTargetScreenField == null)
                    sPrevScreenField = sField;
                if (sPrevScreenField != null) if (sTargetScreenField != null) if (sNextScreenField != null) 
                    break;      // All targets found
            }
            if (sField == m_ChildFocused)
                sTargetScreenField = sField;    // In case focus on a control that doesn't accept focus
        }
        if (sPrevScreenField == null)
            sPrevScreenField = sLastFocusTarget;  // Last field
        if (sNextScreenField == null)
            sNextScreenField = sFirstFocusTarget; // First field
        if (iSelectField == DBConstants.SELECT_PREV_FIELD)
            sNextScreenField = sPrevScreenField;  // Tab backwards
        if (iSelectField == DBConstants.SELECT_FIRST_FIELD)
            sNextScreenField = sFirstFocusTarget; // First field
        sField = sNextScreenField;
        return sField;
    }
35653
public static JMessageListener createScreenMessageListener(FieldList record, BaseScreenModel screen)
    {        // Now add listeners to update screen when data changes
        FieldTable table = record.getTable();
        RemoteSession remoteSession = (RemoteSession)table.getRemoteTableType(org.jbundle.model.Remote.class);

        MessageManager messageManager = ((Application)screen.getBaseApplet().getApplication()).getMessageManager();
        MessageReceiver handler = messageManager.getMessageQueue(MessageConstants.RECORD_QUEUE_NAME, MessageConstants.INTRANET_QUEUE).getMessageReceiver();

        Properties properties = new Properties();
        JMessageListener listenerForSession = (JMessageListener)screen.addMessageHandler(record, properties);

        BaseMessageFilter filterForSession = new ClientSessionMessageFilter(MessageConstants.RECORD_QUEUE_NAME, MessageConstants.INTRANET_QUEUE, screen, remoteSession, properties);
        filterForSession.addMessageListener(listenerForSession);
        synchronized (screen.getBaseApplet().getRemoteTask())
        {   // Wait for remote filter to set up before I start accessing the data
            handler.addMessageFilter(filterForSession);
        }
        
        return listenerForSession;
    }
282230
public ScreenParent makeScreen(ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties)
    {
        ScreenParent screen = null;
        if ((iDocMode & MessageLog.MESSAGE_SCREEN_MODE) == MessageLog.MESSAGE_SCREEN_MODE)
        {
            if ((this.getEditMode() == DBConstants.EDIT_ADD) || (this.getEditMode() == DBConstants.EDIT_NONE))
            {
                String strObjectID = parentScreen.getProperty(DBConstants.OBJECT_ID);
                if ((strObjectID != null) && (strObjectID.length() > 0))
                {
                    try {
                        this.setHandle(strObjectID, DBConstants.BOOKMARK_HANDLE);
                    } catch (DBException ex)    {
                        ex.printStackTrace();
                    }
                }
            }
            if ((this.getEditMode() == DBConstants.EDIT_CURRENT) || (this.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
            {
                String strScreenClass = this.getProperty(ScreenMessageTransport.SCREEN_SCREEN);
                if (strScreenClass == null)
                    strScreenClass = this.getProperty(DBParams.SCREEN);
                if (strScreenClass != null)
                {
                    parentScreen.setProperty(TrxMessageHeader.LOG_TRX_ID, this.getProperty(TrxMessageHeader.LOG_TRX_ID));
                    screen = Record.makeNewScreen(strScreenClass, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, null, true);
                }
            }
            if (screen == null) // ? I don't NOW what else to do?
                screen = Record.makeNewScreen(MESSAGE_LOG_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        }
        else if ((iDocMode & MessageLog.SOURCE_SCREEN_MODE) == MessageLog.SOURCE_SCREEN_MODE)
        {
            String strReferenceClass = this.getProperty(TrxMessageHeader.REFERENCE_CLASS);
            String strReferenceID = this.getField(MessageLog.REFERENCE_ID).toString();
            if (strReferenceID == null)
                strReferenceID = this.getProperty(TrxMessageHeader.REFERENCE_ID);
            if ((strReferenceClass != null) && (strReferenceID != null))
            {
                Record record = Record.makeRecordFromClassName(strReferenceClass, this.findRecordOwner());
                if (record != null)
                {
                    try {
                        record.addNew();
                        record.getCounterField().setString(strReferenceID);
                        if (record.seek(null))
                        {
                            iDocMode = ScreenConstants.MAINT_MODE;
                            screen = record.makeScreen(itsLocation, parentScreen, iDocMode, properties);
                        }
                    } catch (DBException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        else if ((iDocMode & ScreenConstants.MAINT_MODE) == ScreenConstants.MAINT_MODE)
            screen = Record.makeNewScreen(MESSAGE_LOG_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        else
            screen = Record.makeNewScreen(MESSAGE_LOG_GRID_SCREEN_CLASS, itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);
        return screen;
    }
929230
public ScreenFieldView setupScreenFieldView(ScreenField model, Class<?> screenFieldClass, boolean bEditableControl)
    {
        if (screenFieldClass == null)
            screenFieldClass = model.getClass();
        ScreenFieldView screenFieldView = this.getViewClassForModel(screenFieldClass);
        screenFieldView.init(model, bEditableControl);
        return screenFieldView;
    }
712074
public void setupSFields()
    {
        BaseField field = this.getMainRecord().getField(ProgramControl.PROJECT_NAME);
        field.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY);
        
        SCannedBox button = new SCannedBox(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, ProgramControl.SET_DEFAULT_COMMAND, Constants.SUBMIT, ProgramControl.SET_DEFAULT_COMMAND, null);
        
        field.setHidden(true);
        super.setupSFields();
        field.setHidden(false);
    }
789580
protected LookAndFeels setDefaultLookAndFeel(@NonNull LookAndFeels lookAndFeels,
		Component component)
	{
		try
		{
			LookAndFeels.setLookAndFeel(lookAndFeels, component);
			setCurrentLookAndFeels(lookAndFeels);
		}
		catch (final ClassNotFoundException | InstantiationException | IllegalAccessException
			| UnsupportedLookAndFeelException e)
		{
			String title = e.getLocalizedMessage();
			String htmlMessage = "<html><body width='650'>" + "<h2>" + title + "</h2>" + "<p>"
				+ e.getMessage();
			JOptionPane.showMessageDialog(this, htmlMessage, title, JOptionPane.ERROR_MESSAGE);
			log.log(Level.SEVERE, e.getMessage(), e);
		}
		return lookAndFeels;
	}