Logo Search packages:      
Sourcecode: ooeclipseintegration version File versions  Download package

void org::openoffice::ide::eclipse::core::wizards::NewUnoProjectPage::fieldChanged ( FieldEvent  e  )  [inline]

Method called when the row has changed

Parameters:
e the field event thrown

Implements org::openoffice::ide::eclipse::core::gui::rows::IFieldChangedListener.

Definition at line 500 of file NewUnoProjectPage.java.

References org::openoffice::ide::eclipse::core::gui::rows::FieldEvent::getProperty(), and org::openoffice::ide::eclipse::core::gui::rows::FieldEvent::getValue().

                                             {
            
            setPageComplete(validatePage());

            // Check the prefix correctness
            if (e.getProperty().equals(PREFIX)){

                  String newCompanyPrefix = e.getValue();
                  /**
                   * <p>The company prefix is a package like name used by the project
                   * to build the idl file path and the implementation path.</p>
                   */
                  if (!newCompanyPrefix.matches(
                  "([a-zA-Z][a-zA-Z0-9]*)(.[a-zA-Z][a-zA-Z0-9]*)*")){ //$NON-NLS-1$
                        /**
                         * <p>If the new company prefix is invalid, an error message
                         * is set.</p>
                         */
                        setErrorMessage(Messages.getString("NewUnoProjectPage.InvalidPrefixError")); //$NON-NLS-1$

                        setPageComplete(false);
                  } else {
                        setErrorMessage(null);
                        checkWhiteSpaces();
                  }
                  
                  // Check the implementation extension correctness
                  if (e.getProperty().equals(OUTPUT_EXT)){
                        String newOuputExt = e.getValue();
                        /**
                         * <p>The implementation extension is a single word which could 
                         * contain numbers. It have to begin with a letter.</p> 
                         */
                        
                        if (!newOuputExt.matches("[a-zA-Z][a-zA-Z0-9]*")){ //$NON-NLS-1$
                              /**
                               * <p>If the new implementation extension is invalid, it is set to
                               * the empty string with an error message.</p>
                               */
                              
                              setErrorMessage(Messages.getString("NewUnoProjectPage.InvalidCompError")); //$NON-NLS-1$
                              setPageComplete(false);
                        } else {
                              setErrorMessage(null);
                              if (Platform.getOS().equals(Platform.OS_WIN32)) {
                                    setMessage("It is not recommended to have any whitespace inthe project path:\nthe project might fail to build",
                                          WARNING);
                              }
                        }
                  }
                  
                  ((NewUnoProjectWizard)getWizard()).pageChanged(this);
            }
      }


Generated by  Doxygen 1.6.0   Back to index