public void tryToRestoreFieldData(CmsActiveFieldData fieldDataToBeRestored) {

        if (fieldDataToBeRestored == null) {
            return;
        }
        m_markedProperty = null;
        final String propName = fieldDataToBeRestored.getProperty();
        final String tabName = fieldDataToBeRestored.getTab();
        m_markedProperty = propName;
        final int tabIndex;
        if (TAB_INDIVIDUAL.equals(tabName)) {
            tabIndex = 1;
        } else if (TAB_SHARED.equals(tabName)) {
            tabIndex = 2;
        } else {
            tabIndex = 0;
        }

        Timer timer = new Timer() {

            @Override
            public void run() {

                if ((tabIndex >= 0) && (tabIndex < m_tabPanel.getTabCount())) {
                    I_CmsFormField markedField = null;
                    m_tabPanel.selectTab(tabIndex);
                    @SuppressWarnings("synthetic-access")
                    Collection<I_CmsFormField> fieldsForTab = m_fieldsByGroup.get(tabName);
                    if ((fieldsForTab != null) && !fieldsForTab.isEmpty()) {
                        for (I_CmsFormField currentField : fieldsForTab) {
                            if (currentField.getLayoutData().get(LD_PROPERTY).equals(propName)) {
                                markedField = currentField;
                                break;
                            }
                        }
                    }
                    if (markedField != null) {
                        final I_CmsFormField constMarkedField = markedField;
                        Timer timer2 = new Timer() {

                            @Override
                            @SuppressWarnings("synthetic-access")
                            public void run() {

                                focusField(constMarkedField);
                            }

                        };
                        timer2.schedule(1);
                    }
                }

            }

            private void focusField(final I_CmsFormField constMarkedField) {

                I_CmsFormWidget widget = constMarkedField.getWidget();
                if (widget instanceof CmsTextBox) {
                    CmsTextBox box = (CmsTextBox)widget;
                    box.selectAll();
                    box.setFocus(true);
                } else if (widget instanceof CmsTextArea) {
                    CmsTextArea textarea = ((CmsTextArea)widget);
                    textarea.selectAll();
                    textarea.setFocus(true);
                }
            }
        };
        timer.schedule(1);

    }
public void tryToRestoreFieldData ( CmsActiveFieldData fieldDataToBeRestored ) { if ( fieldDataToBeRestored == null ) { return ; } m_markedProperty = null ; final String propName = fieldDataToBeRestored . getProperty ( ) ; final String tabName = fieldDataToBeRestored . getTab ( ) ; m_markedProperty = propName ; final int tabIndex ; if ( TAB_INDIVIDUAL . equals ( tabName ) ) { tabIndex = 1 ; } else if ( TAB_SHARED . equals ( tabName ) ) { tabIndex = 2 ; } else { tabIndex = 0 ; } Timer timer = new Timer ( ) { @ Override public void run ( ) { if ( ( tabIndex >= 0 ) && ( tabIndex < m_tabPanel . getTabCount ( ) ) ) { I_CmsFormField markedField = null ; m_tabPanel . selectTab ( tabIndex ) ; @ SuppressWarnings ( "synthetic-access" ) Collection < I_CmsFormField > fieldsForTab = m_fieldsByGroup . get ( tabName ) ; if ( ( fieldsForTab != null ) && ! fieldsForTab . isEmpty ( ) ) { for ( I_CmsFormField currentField : fieldsForTab ) { if ( currentField . getLayoutData ( ) . get ( LD_PROPERTY ) . equals ( propName ) ) { markedField = currentField ; break ; } } } if ( markedField != null ) { final I_CmsFormField constMarkedField = markedField ; Timer timer2 = new Timer ( ) { @ Override @ SuppressWarnings ( "synthetic-access" ) public void run ( ) { focusField ( constMarkedField ) ; } } ; timer2 . schedule ( 1 ) ; } } } private void focusField ( final I_CmsFormField constMarkedField ) { I_CmsFormWidget widget = constMarkedField . getWidget ( ) ; if ( widget instanceof CmsTextBox ) { CmsTextBox box = ( CmsTextBox ) widget ; box . selectAll ( ) ; box . setFocus ( true ) ; } else if ( widget instanceof CmsTextArea ) { CmsTextArea textarea = ( ( CmsTextArea ) widget ) ; textarea . selectAll ( ) ; textarea . setFocus ( true ) ; } } } ; timer . schedule ( 1 ) ; }
Tries to restore the active field data.<p>

@param fieldDataToBeRestored the field data which should be restored (may be null, in which case this method does nothing)