idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
15,100 | public static Map < String , Object > getAllDatePatterns ( ) throws IllegalAccessException { final Field [ ] fields = DatePatterns . class . getFields ( ) ; final Map < String , Object > patterns = new HashMap < > ( fields . length ) ; for ( final Field field : fields ) { patterns . put ( field . getName ( ) , field . get ( field . getName ( ) ) ) ; } return patterns ; } | Returns a map with all date patterns from the Interface DatePatterns . As key is the name from the pattern . |
15,101 | private Control createPageControl ( Composite parent ) { Composite composite = new Composite ( parent , SWT . NONE ) ; composite . setLayout ( new GridLayout ( 1 , false ) ) ; GridData gridData = new GridData ( GridData . HORIZONTAL_ALIGN_FILL | GridData . VERTICAL_ALIGN_FILL ) ; composite . setLayoutData ( gridData ) ; Label fieldLabel = new Label ( composite , SWT . NONE ) ; fieldLabel . setText ( "&Query Text:" ) ; m_queryTextField = new Text ( composite , SWT . BORDER | SWT . V_SCROLL | SWT . H_SCROLL ) ; GridData data = new GridData ( GridData . FILL_HORIZONTAL ) ; data . heightHint = 100 ; m_queryTextField . setLayoutData ( data ) ; m_queryTextField . addModifyListener ( new ModifyListener ( ) { public void modifyText ( ModifyEvent e ) { validateData ( ) ; } } ) ; setPageComplete ( false ) ; return composite ; } | Creates custom control for user - defined query text . |
15,102 | private void initializeControl ( ) { DataSetDesign dataSetDesign = getInitializationDesign ( ) ; if ( dataSetDesign == null ) return ; String queryText = dataSetDesign . getQueryText ( ) ; if ( queryText == null ) return ; m_queryTextField . setText ( queryText ) ; validateData ( ) ; setMessage ( DEFAULT_MESSAGE ) ; } | Initializes the page control with the last edited data set design . |
15,103 | private void validateData ( ) { boolean isValid = ( m_queryTextField != null && getQueryText ( ) != null && getQueryText ( ) . trim ( ) . length ( ) > 0 ) ; if ( isValid ) setMessage ( DEFAULT_MESSAGE ) ; else setMessage ( "Requires input value." , ERROR ) ; setPageComplete ( isValid ) ; } | Validates the user - defined value in the page control exists and not a blank text . Set page message accordingly . |
15,104 | private void savePage ( DataSetDesign dataSetDesign ) { String queryText = getQueryText ( ) ; dataSetDesign . setQueryText ( queryText ) ; IConnection customConn = null ; try { IDriver customDriver = new org . orienteer . birt . orientdb . impl . Driver ( ) ; customConn = customDriver . getConnection ( null ) ; java . util . Properties connProps = DesignSessionUtil . getEffectiveDataSourceProperties ( getInitializationDesign ( ) . getDataSourceDesign ( ) ) ; customConn . open ( connProps ) ; updateDesign ( dataSetDesign , customConn , queryText ) ; } catch ( OdaException e ) { dataSetDesign . setResultSets ( null ) ; dataSetDesign . setParameters ( null ) ; e . printStackTrace ( ) ; } finally { closeConnection ( customConn ) ; } } | Saves the user - defined value in this page and updates the specified dataSetDesign with the latest design definition . |
15,105 | private void updateDesign ( DataSetDesign dataSetDesign , IConnection conn , String queryText ) throws OdaException { IQuery query = conn . newQuery ( null ) ; query . prepare ( queryText ) ; try { IResultSetMetaData md = query . getMetaData ( ) ; updateResultSetDesign ( md , dataSetDesign ) ; } catch ( OdaException e ) { dataSetDesign . setResultSets ( null ) ; e . printStackTrace ( ) ; } try { IParameterMetaData paramMd = query . getParameterMetaData ( ) ; updateParameterDesign ( paramMd , dataSetDesign ) ; } catch ( OdaException ex ) { dataSetDesign . setParameters ( null ) ; ex . printStackTrace ( ) ; } } | Updates the given dataSetDesign with the queryText and its derived metadata obtained from the ODA runtime connection . |
15,106 | private void updateResultSetDesign ( IResultSetMetaData md , DataSetDesign dataSetDesign ) throws OdaException { ResultSetColumns columns = DesignSessionUtil . toResultSetColumnsDesign ( md ) ; ResultSetDefinition resultSetDefn = DesignFactory . eINSTANCE . createResultSetDefinition ( ) ; resultSetDefn . setResultSetColumns ( columns ) ; dataSetDesign . setPrimaryResultSet ( resultSetDefn ) ; dataSetDesign . getResultSets ( ) . setDerivedMetaData ( true ) ; } | Updates the specified data set design s result set definition based on the specified runtime metadata . |
15,107 | private void updateParameterDesign ( IParameterMetaData paramMd , DataSetDesign dataSetDesign ) throws OdaException { DataSetParameters paramDesign = DesignSessionUtil . toDataSetParametersDesign ( paramMd , DesignSessionUtil . toParameterModeDesign ( IParameterMetaData . parameterModeIn ) ) ; dataSetDesign . setParameters ( paramDesign ) ; if ( paramDesign == null ) return ; paramDesign . setDerivedMetaData ( true ) ; } | Updates the specified data set design s parameter definition based on the specified runtime metadata . |
15,108 | private void closeConnection ( IConnection conn ) { try { if ( conn != null && conn . isOpen ( ) ) conn . close ( ) ; } catch ( OdaException e ) { e . printStackTrace ( ) ; } } | Attempts to close given ODA connection . |
15,109 | public int getManhattanDistance ( Point2 that ) { return Math . abs ( x - that . x ) + Math . abs ( y - that . y ) ; } | Returns the manhattan distance between this and specified points . |
15,110 | public Point2 move ( Direction4 direction ) { return new Point2 ( x + direction . dx , y + direction . dy ) ; } | This method is deprecated so please use move method in Direction4 . Returns the moved location from this position with the specified direction . |
15,111 | public BaseField setupField ( int iFieldSeq ) { BaseField field = null ; if ( iFieldSeq == DBConstants . MAIN_FIELD ) field = new CounterField ( this , "ID" , Constants . DEFAULT_FIELD_LENGTH , null , null ) ; return field ; } | Add this field in the Record s field sequence .. |
15,112 | public KeyArea setupKey ( int iKeyArea ) { KeyArea keyArea = null ; if ( iKeyArea == DBConstants . MAIN_KEY_FIELD ) { keyArea = this . makeIndex ( DBConstants . UNIQUE , DBConstants . PRIMARY_KEY ) ; keyArea . addKeyField ( DBConstants . MAIN_FIELD , DBConstants . ASCENDING ) ; } return keyArea ; } | Add this key area description to the Record .. |
15,113 | private static < T extends Node > Map . Entry < CSNodeWrapper , T > findEntry ( Map < CSNodeWrapper , T > map , Integer id ) { if ( id == null ) return null ; for ( final Map . Entry < CSNodeWrapper , T > entry : map . entrySet ( ) ) { if ( entry . getKey ( ) . getNextNode ( ) != null && entry . getKey ( ) . getNextNode ( ) . getId ( ) . equals ( id ) ) { return entry ; } } return null ; } | Find the entry how has a next node that matches a specified by a node id . |
15,114 | private static < T extends Node > Map . Entry < CSNodeWrapper , T > findLastEntry ( Map < CSNodeWrapper , T > map ) { Map . Entry < CSNodeWrapper , T > nodeEntry = null ; for ( final Map . Entry < CSNodeWrapper , T > entry : map . entrySet ( ) ) { if ( entry . getKey ( ) . getNextNode ( ) == null ) { nodeEntry = entry ; break ; } } return nodeEntry ; } | Finds the initial entry for the unordered map . |
15,115 | public boolean checkSecurity ( JBasePanel baseScreen ) { if ( ( this . getApplication ( ) == null ) || ( baseScreen == null ) ) return true ; int iErrorCode = baseScreen . checkSecurity ( this . getApplication ( ) ) ; if ( iErrorCode == Constants . READ_ACCESS ) { int iLevel = Constants . LOGIN_USER ; try { iLevel = Integer . parseInt ( this . getProperty ( Params . SECURITY_LEVEL ) ) ; } catch ( NumberFormatException ex ) { } if ( iLevel == Constants . LOGIN_USER ) iErrorCode = Constants . AUTHENTICATION_REQUIRED ; else if ( iLevel == Constants . LOGIN_AUTHENTICATED ) iErrorCode = Constants . ACCESS_DENIED ; } if ( iErrorCode == Constants . NORMAL_RETURN ) return true ; if ( iErrorCode == Constants . ACCESS_DENIED ) { String strMessage = this . getApplication ( ) . getSecurityErrorText ( iErrorCode ) ; JOptionPane . showConfirmDialog ( this , strMessage , strMessage , JOptionPane . OK_CANCEL_OPTION ) ; return false ; } String strDisplay = null ; if ( ( iErrorCode == Constants . LOGIN_REQUIRED ) || ( iErrorCode == Constants . AUTHENTICATION_REQUIRED ) ) { iErrorCode = onLogonDialog ( ) ; if ( iErrorCode == JOptionPane . CANCEL_OPTION ) return false ; if ( iErrorCode == Constants . NORMAL_RETURN ) return true ; strDisplay = this . getLastError ( iErrorCode ) ; } else strDisplay = this . getLastError ( iErrorCode ) ; JOptionPane . showConfirmDialog ( this , strDisplay , "Error" , JOptionPane . OK_CANCEL_OPTION ) ; return false ; } | This is just for convenience . A simple way to change or set the screen for this applet . The old screen is removed and the new screen is added . This method is also used to switch a sub - screen to a new sub - screen . |
15,116 | public int onLogonDialog ( ) { String strDisplay = "Login required" ; strDisplay = this . getTask ( ) . getString ( strDisplay ) ; for ( int i = 1 ; i < 3 ; i ++ ) { String strUserName = this . getProperty ( Params . USER_NAME ) ; Frame frame = ScreenUtil . getFrame ( this ) ; LoginDialog dialog = new LoginDialog ( frame , true , strDisplay , strUserName ) ; if ( frame != null ) ScreenUtil . centerDialogInFrame ( dialog , frame ) ; dialog . setVisible ( true ) ; int iOption = dialog . getReturnStatus ( ) ; if ( iOption == LoginDialog . NEW_USER_OPTION ) iOption = this . createNewUser ( dialog ) ; if ( iOption != JOptionPane . OK_OPTION ) return iOption ; strUserName = dialog . getUserName ( ) ; String strPassword = dialog . getPassword ( ) ; try { byte [ ] bytes = strPassword . getBytes ( Base64 . DEFAULT_ENCODING ) ; bytes = Base64 . encodeSHA ( bytes ) ; char [ ] chars = Base64 . encode ( bytes ) ; strPassword = new String ( chars ) ; } catch ( NoSuchAlgorithmException ex ) { ex . printStackTrace ( ) ; } catch ( UnsupportedEncodingException ex ) { ex . printStackTrace ( ) ; } String strDomain = this . getProperty ( Params . DOMAIN ) ; int iSuccess = this . getApplication ( ) . login ( this , strUserName , strPassword , strDomain ) ; if ( iSuccess == Constants . NORMAL_RETURN ) { if ( this . getApplication ( ) . getMuffinManager ( ) != null ) if ( this . getApplication ( ) . getMuffinManager ( ) . isServiceAvailable ( ) ) { if ( dialog . getSaveState ( ) == true ) this . getApplication ( ) . getMuffinManager ( ) . setMuffin ( Params . USER_ID , this . getApplication ( ) . getProperty ( Params . USER_ID ) ) ; else this . getApplication ( ) . getMuffinManager ( ) . setMuffin ( Params . USER_ID , null ) ; } return iSuccess ; } } return this . setLastError ( strDisplay ) ; } | Display the logon dialog and login . |
15,117 | public int onChangePassword ( ) { String strDisplay = "Login required" ; strDisplay = this . getTask ( ) . getString ( strDisplay ) ; for ( int i = 1 ; i < 3 ; i ++ ) { String strUserName = this . getProperty ( Params . USER_NAME ) ; Frame frame = ScreenUtil . getFrame ( this ) ; ChangePasswordDialog dialog = new ChangePasswordDialog ( frame , true , strDisplay , strUserName ) ; ScreenUtil . centerDialogInFrame ( dialog , frame ) ; dialog . setVisible ( true ) ; int iOption = dialog . getReturnStatus ( ) ; if ( iOption != JOptionPane . OK_OPTION ) return iOption ; strUserName = dialog . getUserName ( ) ; String strPassword = dialog . getCurrentPassword ( ) ; String strNewPassword = dialog . getNewPassword ( ) ; try { byte [ ] bytes = strPassword . getBytes ( Base64 . DEFAULT_ENCODING ) ; bytes = Base64 . encodeSHA ( bytes ) ; char [ ] chars = Base64 . encode ( bytes ) ; strPassword = new String ( chars ) ; bytes = strNewPassword . getBytes ( Base64 . DEFAULT_ENCODING ) ; bytes = Base64 . encodeSHA ( bytes ) ; chars = Base64 . encode ( bytes ) ; strNewPassword = new String ( chars ) ; } catch ( NoSuchAlgorithmException ex ) { ex . printStackTrace ( ) ; } catch ( UnsupportedEncodingException ex ) { ex . printStackTrace ( ) ; } int errorCode = this . getApplication ( ) . createNewUser ( this , strUserName , strPassword , strNewPassword ) ; if ( errorCode == Constants . NORMAL_RETURN ) return errorCode ; } return this . setLastError ( strDisplay ) ; } | Display the change password dialog and change the password . |
15,118 | public boolean changeSubScreen ( Container parent , JBasePanel baseScreen , String strCommandToPush , int options ) { if ( ( parent == null ) || ( parent == this ) ) parent = m_parent ; boolean bScreenChange = false ; if ( ! this . checkSecurity ( baseScreen ) ) { baseScreen . free ( ) ; return false ; } this . freeSubComponents ( parent ) ; if ( parent . getComponentCount ( ) > 0 ) { parent . removeAll ( ) ; bScreenChange = true ; } JComponent screen = baseScreen ; if ( ! ( parent . getLayout ( ) instanceof BoxLayout ) ) parent . setLayout ( new BorderLayout ( ) ) ; screen = baseScreen . setupNewScreen ( baseScreen ) ; screen . setMinimumSize ( new Dimension ( 100 , 100 ) ) ; screen . setAlignmentX ( LEFT_ALIGNMENT ) ; screen . setAlignmentY ( TOP_ALIGNMENT ) ; parent . add ( screen ) ; if ( bScreenChange ) { this . invalidate ( ) ; this . validate ( ) ; this . repaint ( ) ; baseScreen . resetFocus ( ) ; } if ( parent == m_parent ) { if ( strCommandToPush == null ) strCommandToPush = baseScreen . getScreenCommand ( ) ; if ( strCommandToPush != null ) if ( ( options & Constants . DONT_PUSH_HISTORY ) == 0 ) this . pushHistory ( strCommandToPush , ( ( options & Constants . DONT_PUSH_TO_BROWSER ) == Constants . PUSH_TO_BROWSER ) ) ; } return true ; } | Change the sub - screen . |
15,119 | public ImageIcon loadImageIcon ( String filename , String description ) { filename = Util . getImageFilename ( filename , "buttons" ) ; URL url = null ; if ( this . getApplication ( ) != null ) url = this . getApplication ( ) . getResourceURL ( filename , this ) ; if ( url == null ) { try { return new ImageIcon ( filename , description ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; return null ; } } return new ImageIcon ( url , description ) ; } | Get this image . |
15,120 | public void setBackgroundColor ( Color colorBackground ) { m_colorBackground = colorBackground ; if ( m_parent != null ) { JTiledImage panel = ( JTiledImage ) JBasePanel . getSubScreen ( this , JTiledImage . class ) ; if ( panel != null ) panel . setBackground ( colorBackground ) ; } } | Set the background image s color . |
15,121 | public static Color nameToColor ( String strColor ) { final Object [ ] [ ] obj = { { "black" , Color . black } , { "blue" , Color . blue } , { "cyan" , Color . cyan } , { "darkGray" , Color . darkGray } , { "gray" , Color . gray } , { "green" , Color . green } , { "lightGray" , Color . lightGray } , { "magenta" , Color . magenta } , { "orange" , Color . orange } , { "pink" , Color . pink } , { "red" , Color . red } , { "white" , Color . white } , { "yellow" , Color . yellow } } ; for ( int i = 0 ; i < obj . length ; i ++ ) { if ( strColor . equalsIgnoreCase ( ( String ) obj [ i ] [ 0 ] ) ) return ( Color ) obj [ i ] [ 1 ] ; } try { return Color . decode ( strColor ) ; } catch ( NumberFormatException ex ) { } return null ; } | Convert this color string to the Color object . |
15,122 | public boolean doAction ( String strAction , int iOptions ) { if ( Constants . BACK . equalsIgnoreCase ( strAction ) ) { String strPrevAction = this . popHistory ( 1 , false ) ; strAction = this . popHistory ( 1 , false ) ; if ( strAction != null ) { this . pushHistory ( strAction , false ) ; strAction = this . popHistory ( 1 , true ) ; } if ( strAction != null ) { iOptions = iOptions | Constants . DONT_PUSH_TO_BROWSER ; if ( ! Constants . BACK . equalsIgnoreCase ( strAction ) ) return this . doAction ( strAction , iOptions ) ; } else if ( strPrevAction != null ) this . pushHistory ( strPrevAction , false ) ; } if ( Constants . HELP . equalsIgnoreCase ( strAction ) ) { String strPrevAction = this . popHistory ( 1 , true ) ; this . pushHistory ( strPrevAction , ( ( iOptions & Constants . DONT_PUSH_TO_BROWSER ) == Constants . PUSH_TO_BROWSER ) ) ; if ( ( strPrevAction != null ) && ( strPrevAction . length ( ) > 0 ) && ( strPrevAction . charAt ( 0 ) != '?' ) ) strPrevAction = "?" + strPrevAction ; String strURL = Util . addURLParam ( strPrevAction , Params . HELP , Constants . BLANK ) ; iOptions = this . getHelpPageOptions ( iOptions ) ; return this . getApplication ( ) . showTheDocument ( strURL , this , iOptions ) ; } if ( strAction != null ) if ( strAction . indexOf ( '=' ) != - 1 ) { Map < String , Object > properties = new Hashtable < String , Object > ( ) ; Util . parseArgs ( properties , strAction ) ; String strApplet = ( String ) properties . get ( Params . APPLET ) ; if ( strApplet != null ) { this . setProperties ( properties ) ; if ( ! this . addSubPanels ( null , iOptions ) ) return false ; this . popHistory ( 1 , false ) ; this . pushHistory ( UrlUtil . propertiesToUrl ( properties ) , false ) ; return true ; } } if ( Util . isURL ( strAction ) ) this . getApplication ( ) . showTheDocument ( strAction , this , ThinMenuConstants . EXTERNAL_LINK ) ; return false ; } | Do some applet - wide action . For example submit or reset . Pass this action down to all the JBaseScreens . Remember to override this method to send the actual data! |
15,123 | public int getHelpPageOptions ( int iOptions ) { String strPreference = this . getProperty ( ThinMenuConstants . USER_HELP_DISPLAY ) ; if ( ( strPreference == null ) || ( strPreference . length ( ) == 0 ) ) strPreference = this . getProperty ( ThinMenuConstants . HELP_DISPLAY ) ; if ( this . getHelpView ( ) == null ) if ( ThinMenuConstants . HELP_PANE . equalsIgnoreCase ( strPreference ) ) strPreference = null ; if ( ( strPreference == null ) || ( strPreference . length ( ) == 0 ) ) { strPreference = ThinMenuConstants . HELP_PANE ; } if ( ThinMenuConstants . HELP_WEB . equalsIgnoreCase ( strPreference ) ) iOptions = ThinMenuConstants . HELP_WEB_OPTION ; else if ( ThinMenuConstants . HELP_PANE . equalsIgnoreCase ( strPreference ) ) iOptions = ThinMenuConstants . HELP_PANE_OPTION ; else if ( ThinMenuConstants . HELP_WINDOW . equalsIgnoreCase ( strPreference ) ) iOptions = ThinMenuConstants . HELP_WINDOW_OPTION ; else iOptions = ThinMenuConstants . HELP_PANE_OPTION ; return iOptions ; } | Get the display preference for the help window . |
15,124 | public RemoteSession makeRemoteSession ( RemoteSession parentSessionObject , String strSessionClass ) { RemoteTask server = ( RemoteTask ) this . getRemoteTask ( ) ; try { synchronized ( server ) { if ( parentSessionObject == null ) return ( RemoteSession ) server . makeRemoteSession ( strSessionClass ) ; else return ( RemoteSession ) parentSessionObject . makeRemoteSession ( strSessionClass ) ; } } catch ( RemoteException ex ) { ex . printStackTrace ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return null ; } | Create this session with this class name at the remote server . |
15,125 | public String popHistory ( int quanityToPop , boolean bPopFromBrowser ) { String strHistory = null ; for ( int i = 0 ; i < quanityToPop ; i ++ ) { strHistory = null ; if ( m_vHistory != null ) if ( m_vHistory . size ( ) > 0 ) strHistory = ( String ) m_vHistory . remove ( m_vHistory . size ( ) - 1 ) ; } if ( bPopFromBrowser ) this . popBrowserHistory ( quanityToPop , strHistory != null , this . getStatusText ( Constants . INFORMATION ) ) ; return strHistory ; } | Pop this command off the history stack . |
15,126 | public void popBrowserHistory ( int quanityToPop , boolean bCommandHandledByJava , String browserTitle ) { if ( this . getBrowserManager ( ) != null ) this . getBrowserManager ( ) . popBrowserHistory ( quanityToPop , bCommandHandledByJava , this . getStatusText ( Constants . INFORMATION ) ) ; } | Pop commands off the browser stack . |
15,127 | public String getInitialCommand ( boolean bIncludeAppletCommands ) { String strCommand = Constants . BLANK ; if ( bIncludeAppletCommands ) { if ( this . getProperty ( Params . APPLET ) != null ) strCommand = Util . addURLParam ( strCommand , Params . APPLET , this . getProperty ( Params . APPLET ) ) ; else if ( this . getProperty ( "code" ) != null ) strCommand = Util . addURLParam ( strCommand , Params . APPLET , this . getProperty ( "code" ) ) ; else strCommand = Util . addURLParam ( strCommand , Params . APPLET , this . getClass ( ) . getName ( ) ) ; if ( this . getProperty ( "webStartPropertiesFile" ) != null ) strCommand = Util . addURLParam ( strCommand , "webStartPropertiesFile" , this . getProperty ( "webStartPropertiesFile" ) ) ; else { if ( this . getProperty ( "jnlpjars" ) != null ) strCommand = Util . addURLParam ( strCommand , "jnlpjars" , this . getProperty ( "jnlpjars" ) ) ; if ( this . getProperty ( "jnlpextensions" ) != null ) strCommand = Util . addURLParam ( strCommand , "jnlpextensions" , this . getProperty ( "jnlpextensions" ) ) ; if ( this . getProperty ( ScreenUtil . BACKGROUND_COLOR ) != null ) strCommand = Util . addURLParam ( strCommand , ScreenUtil . BACKGROUND_COLOR , this . getProperty ( ScreenUtil . BACKGROUND_COLOR ) ) ; if ( this . getProperty ( Params . BACKGROUND ) != null ) strCommand = Util . addURLParam ( strCommand , Params . BACKGROUND , this . getProperty ( Params . BACKGROUND ) ) ; if ( this . getProperty ( "webStart" ) != null ) strCommand = Util . addURLParam ( strCommand , "webStart" , this . getProperty ( "webStart" ) ) ; } if ( this . getProperty ( Params . USER_ID ) != null ) strCommand = Util . addURLParam ( strCommand , Params . USER_ID , this . getProperty ( Params . USER_ID ) ) ; if ( this . getProperty ( Params . USER_NAME ) != null ) strCommand = Util . addURLParam ( strCommand , Params . USER_NAME , this . getProperty ( Params . USER_NAME ) ) ; } if ( ( this . getProperty ( Params . SCREEN ) != null ) && ( this . getProperty ( Params . SCREEN ) . length ( ) > 0 ) ) strCommand = Util . addURLParam ( strCommand , Params . SCREEN , this . getProperty ( Params . SCREEN ) ) ; if ( strCommand . length ( ) == 0 ) { String strMenu = this . getProperty ( Params . MENU ) ; if ( strMenu == null ) strMenu = Constants . BLANK ; strCommand = Util . addURLParam ( strCommand , Params . MENU , strMenu ) ; } return strCommand ; } | Get the original screen params . |
15,128 | public String cleanCommand ( String command ) { if ( command == null ) return command ; Map < String , Object > properties = Util . parseArgs ( null , command ) ; properties . remove ( Params . APPLET ) ; properties . remove ( "code" ) ; properties . remove ( "jnlpjars" ) ; properties . remove ( "jnlpextensions" ) ; properties . remove ( ScreenUtil . BACKGROUND_COLOR ) ; properties . remove ( Params . BACKGROUND ) ; return Util . propertiesToUrl ( properties ) ; } | Clean the javascript command for java use . |
15,129 | public boolean onAbout ( ) { Application application = this . getApplication ( ) ; application . getResources ( null , true ) ; String strTitle = this . getString ( ThinMenuConstants . ABOUT ) ; String strMessage = this . getString ( "Copyright" ) ; JOptionPane . showMessageDialog ( ScreenUtil . getFrame ( this ) , strMessage , strTitle , JOptionPane . INFORMATION_MESSAGE ) ; return true ; } | Throw up a dialog box to show about info . |
15,130 | public void setScreenProperties ( PropertyOwner propertyOwner , Map < String , Object > properties ) { Frame frame = ScreenUtil . getFrame ( this ) ; ScreenUtil . updateLookAndFeel ( ( Frame ) frame , propertyOwner , properties ) ; Color colorBackgroundNew = ScreenUtil . getColor ( ScreenUtil . BACKGROUND_COLOR , propertyOwner , properties ) ; if ( colorBackgroundNew != null ) this . setBackgroundColor ( colorBackgroundNew ) ; } | Change the screen properties to these properties . |
15,131 | @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public void setupLookAndFeel ( PropertyOwner propertyOwner ) { Map < String , Object > properties = null ; if ( propertyOwner == null ) propertyOwner = this . retrieveUserProperties ( Params . SCREEN ) ; if ( propertyOwner == null ) { RemoteTask task = ( RemoteTask ) this . getApplication ( ) . getRemoteTask ( null , null , false ) ; if ( task != null ) { try { properties = ( Map ) task . doRemoteAction ( Params . RETRIEVE_USER_PROPERTIES , properties ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } String backgroundName = null ; if ( propertyOwner != null ) if ( propertyOwner . getProperty ( Params . BACKGROUNDCOLOR ) != null ) backgroundName = propertyOwner . getProperty ( Params . BACKGROUNDCOLOR ) ; if ( backgroundName == null ) if ( properties != null ) backgroundName = ( String ) properties . get ( Params . BACKGROUNDCOLOR ) ; if ( backgroundName != null ) this . setBackgroundColor ( BaseApplet . nameToColor ( backgroundName ) ) ; Container top = this ; while ( top . getParent ( ) != null ) { top = top . getParent ( ) ; } ScreenUtil . updateLookAndFeel ( top , propertyOwner , properties ) ; } | Get the screen properties and set up the look and feel . |
15,132 | public GridBagConstraints getGBConstraints ( ) { if ( m_gbconstraints == null ) m_gbconstraints = new GridBagConstraints ( ) ; else { m_gbconstraints . gridx = GridBagConstraints . RELATIVE ; m_gbconstraints . gridy = GridBagConstraints . RELATIVE ; m_gbconstraints . gridwidth = 1 ; m_gbconstraints . gridheight = 1 ; m_gbconstraints . weightx = 0 ; m_gbconstraints . weighty = 0 ; m_gbconstraints . anchor = GridBagConstraints . CENTER ; m_gbconstraints . fill = GridBagConstraints . NONE ; m_gbconstraints . insets . bottom = 0 ; m_gbconstraints . insets . left = 0 ; m_gbconstraints . insets . right = 0 ; m_gbconstraints . insets . top = 0 ; m_gbconstraints . ipadx = 0 ; m_gbconstraints . ipady = 0 ; } return m_gbconstraints ; } | Get standard GridBagConstraints . The grid bag constrain is reset to the original value in this method . |
15,133 | public String getMenuIcon ( FieldList record ) { FieldInfo field = record . getField ( "IconResource" ) ; String strIcon = null ; if ( field != null ) { strIcon = field . toString ( ) ; if ( ( strIcon != null ) && ( strIcon . length ( ) > 0 ) ) return strIcon ; } field = record . getField ( "Type" ) ; if ( ( field != null ) && ( ! field . isNull ( ) ) ) { strIcon = field . toString ( ) ; if ( ( strIcon != null ) && ( strIcon . length ( ) > 0 ) ) { strIcon = strIcon . substring ( 0 , 1 ) . toUpperCase ( ) + strIcon . substring ( 1 ) ; return strIcon ; } } return Constants . BLANK ; } | Get the menu icon . |
15,134 | public String getMenuLink ( FieldList record ) { FieldInfo field = record . getField ( "Type" ) ; if ( ( field != null ) && ( ! field . isNull ( ) ) ) { String strType = field . toString ( ) ; String strParams = record . getField ( "Params" ) . toString ( ) ; if ( strParams == null ) strParams = Constants . BLANK ; else if ( strParams . length ( ) > 0 ) strParams = '&' + strParams ; if ( ( strType != null ) && ( strType . length ( ) > 0 ) ) { String strProgram = record . getField ( "Program" ) . toString ( ) ; if ( strType . equalsIgnoreCase ( Params . MENU ) ) { field = record . getField ( "ID" ) ; String strID = field . toString ( ) ; return '?' + strType + '=' + strID + strParams ; } else if ( strType . equalsIgnoreCase ( "applet" ) ) { return '?' + strType + '=' + strProgram + strParams ; } else if ( strType . equalsIgnoreCase ( "link" ) ) { strParams = strProgram ; if ( ( ( strParams . indexOf ( '.' ) < strParams . indexOf ( '/' ) ) && ( strParams . indexOf ( '.' ) != - 1 ) ) || ( ( strParams . indexOf ( '/' ) == - 1 ) && ( strParams . indexOf ( ':' ) == - 1 ) ) ) strParams = "http://" + strParams ; return strParams ; } } } return this . getMenuName ( record ) ; } | Get the menu command to send to handle command . |
15,135 | public static byte [ ] download ( final URI uri ) throws IOException { final File tmpFile = new File ( uri ) ; return ReadFileExtensions . toByteArray ( tmpFile ) ; } | Downloads Data from the given URI . |
15,136 | public static String getAbsolutPathWithoutFilename ( final File file ) { final String absolutePath = file . getAbsolutePath ( ) ; int lastSlash_index = absolutePath . lastIndexOf ( "/" ) ; if ( lastSlash_index < 0 ) { lastSlash_index = absolutePath . lastIndexOf ( "\\" ) ; } return absolutePath . substring ( 0 , lastSlash_index + 1 ) ; } | Gets the absolut path without the filename . |
15,137 | public static String getCurrentAbsolutPathWithoutDotAndSlash ( ) { final File currentAbsolutPath = new File ( "." ) ; return currentAbsolutPath . getAbsolutePath ( ) . substring ( 0 , currentAbsolutPath . getAbsolutePath ( ) . length ( ) - 2 ) ; } | Gets the current absolut path without the dot and slash . |
15,138 | public static boolean isOpen ( final File file ) throws IOException { boolean open = false ; FileLock lock = null ; try ( RandomAccessFile fileAccess = new RandomAccessFile ( file . getAbsolutePath ( ) , "rw" ) ) { lock = fileAccess . getChannel ( ) . tryLock ( ) ; if ( lock == null ) { open = true ; } else { lock . release ( ) ; } } return open ; } | Not yet implemented . Checks if the given file is open . |
15,139 | public static MappedByteBuffer create ( MapMode mapMode , int maxSize ) throws IOException { Path tmp = Files . createTempFile ( "dynBB" , "tmp" ) ; try ( FileChannel fc = FileChannel . open ( tmp , READ , WRITE , CREATE , DELETE_ON_CLOSE ) ) { return fc . map ( MapMode . READ_WRITE , 0 , maxSize ) ; } } | Creates dynamically growing ByteBuffer upto maxSize . ByteBuffer is created by mapping a temporary file |
15,140 | public static ByteBuffer create ( Path path , int maxSize ) throws IOException { try ( FileChannel fc = FileChannel . open ( path , READ , WRITE , CREATE ) ) { return fc . map ( FileChannel . MapMode . READ_WRITE , 0 , maxSize ) ; } } | Creates dynamically growing ByteBuffer upto maxSize for named file . |
15,141 | public String formatDate ( Date date , int type ) { String string = null ; if ( type == DBConstants . DATE_TIME_FORMAT ) string = XmlUtilities . dateTimeFormat . format ( date ) ; else if ( type == DBConstants . DATE_ONLY_FORMAT ) string = XmlUtilities . dateFormat . format ( date ) ; else if ( type == DBConstants . TIME_ONLY_FORMAT ) string = XmlUtilities . timeFormat . format ( date ) ; return string ; } | FormatDate Method . |
15,142 | public void fieldToControl ( ) { if ( this . getConverter ( ) != null ) { Object objValue = this . getScreenFieldView ( ) . getFieldState ( ) ; if ( this . getScreenFieldView ( ) . getControl ( ) != null ) this . getScreenFieldView ( ) . setComponentState ( this . getScreenFieldView ( ) . getControl ( ) , objValue ) ; } } | Move the field s value to the control . |
15,143 | public void setupControlDesc ( ) { if ( m_screenParent == null ) return ; String strDisplay = m_converterField . getFieldDesc ( ) ; if ( ( strDisplay != null ) && ( strDisplay . length ( ) > 0 ) ) { ScreenLocation descLocation = m_screenParent . getNextLocation ( ScreenConstants . FIELD_DESC , ScreenConstants . DONT_SET_ANCHOR ) ; new SStaticString ( descLocation , m_screenParent , strDisplay ) ; } } | Create the description for this control . |
15,144 | public void printScreen ( PrintWriter out , ResourceBundle reg ) throws DBException { this . getScreenFieldView ( ) . printScreen ( out , reg ) ; } | Display the result in html table format . |
15,145 | public String getInputType ( String strViewType ) { if ( strViewType == null ) strViewType = this . getParentScreen ( ) . getViewFactory ( ) . getViewSubpackage ( ) ; BaseField field = null ; if ( this . getConverter ( ) != null ) field = ( BaseField ) this . getConverter ( ) . getField ( ) ; String strFieldType = "textbox" ; if ( field != null ) strFieldType = field . getInputType ( strViewType ) ; else { if ( this instanceof SPasswordField ) { if ( ScreenModel . HTML_TYPE . equalsIgnoreCase ( strViewType ) ) strFieldType = "password" ; else strFieldType = "secret" ; } else if ( this instanceof SNumberText ) { if ( ScreenModel . HTML_TYPE . equalsIgnoreCase ( strViewType ) ) strFieldType = "float" ; } } return strFieldType ; } | Get the rich text type for this control . |
15,146 | public InputStream sendMessage ( Properties args , int method ) throws IOException { if ( method == GET ) { URL url = new URL ( servlet . toExternalForm ( ) + "?" + toEncodedString ( args ) ) ; return url . openStream ( ) ; } else { URLConnection conn = servlet . openConnection ( ) ; conn . setDoOutput ( true ) ; conn . setUseCaches ( false ) ; PrintStream out = new PrintStream ( conn . getOutputStream ( ) ) ; if ( args != null && args . size ( ) > 0 ) { out . print ( toEncodedString ( args ) ) ; } out . close ( ) ; return conn . getInputStream ( ) ; } } | Send the request . Return the input stream with the response if the request succeeds . |
15,147 | public String toEncodedString ( Properties args ) { StringBuffer sb = new StringBuffer ( ) ; try { if ( args != null ) { String sep = "" ; Enumeration < ? > names = args . propertyNames ( ) ; while ( names . hasMoreElements ( ) ) { String name = ( String ) names . nextElement ( ) ; sb . append ( sep ) . append ( URLEncoder . encode ( name , Constants . URL_ENCODING ) ) . append ( "=" ) . append ( URLEncoder . encode ( args . getProperty ( name ) , Constants . URL_ENCODING ) ) ; sep = "&" ; } } } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return sb . toString ( ) ; } | Encode the arguments in the property set as a URL - encoded string . Multiple name = value pairs are separated by ampersands . |
15,148 | public Converter getTargetField ( Record record ) { if ( record == null ) { BaseTable currentTable = m_recMerge . getTable ( ) . getCurrentTable ( ) ; if ( currentTable == null ) currentTable = m_recMerge . getTable ( ) ; record = currentTable . getRecord ( ) ; } Converter field = null ; if ( fieldName != null ) field = record . getField ( fieldName ) ; else field = record . getField ( m_iFieldSeq ) ; if ( ( m_iSecondaryFieldSeq != - 1 ) || ( secondaryFieldName != null ) ) if ( field instanceof ReferenceField ) if ( ( ( ReferenceField ) field ) . getRecord ( ) != null ) if ( ( ( ReferenceField ) field ) . getRecord ( ) . getTable ( ) != null ) { Record recordSecond = ( ( ReferenceField ) field ) . getReferenceRecord ( ) ; if ( recordSecond != null ) { if ( secondaryFieldName != null ) field = recordSecond . getField ( secondaryFieldName ) ; else field = recordSecond . getField ( m_iSecondaryFieldSeq ) ; } } return field ; } | Get the target field in this record . |
15,149 | protected void writeToOutput ( final Map < String , Object > row ) throws IOException { if ( writer == null ) { CsvMapper mapper = new CsvMapper ( ) ; mapper . disable ( SerializationFeature . CLOSE_CLOSEABLE ) ; mapper . getFactory ( ) . configure ( JsonGenerator . Feature . AUTO_CLOSE_TARGET , false ) ; CsvSchema schema = buildCsvSchema ( row ) ; writer = mapper . writer ( schema ) ; writer . writeValue ( getWriter ( ) , row . keySet ( ) ) ; } writer . writeValue ( getWriter ( ) , row . values ( ) ) ; } | Write a row to the destination . |
15,150 | public CsvSchema buildCsvSchema ( final Map < String , Object > row ) { CsvSchema . Builder builder = CsvSchema . builder ( ) ; Set < String > fields = row . keySet ( ) ; for ( String field : fields ) { builder . addColumn ( field ) ; } return builder . build ( ) ; } | Extrapolate the CSV columns from the row keys . |
15,151 | public int getMaxToClaim ( int nodeCount ) { synchronized ( cluster . allWorkUnits ) { final int total = cluster . allWorkUnits . size ( ) ; if ( total <= 1 ) { return total ; } return ( int ) Math . ceil ( total / ( double ) nodeCount ) ; } } | Determines the maximum number of work units the policy should attempt to claim . |
15,152 | public static double integral ( DoubleUnaryOperator f , double x1 , double x2 , int points ) { double delta = ( x2 - x1 ) / points ; double delta2 = delta / 2.0 ; double sum = 0 ; double y1 = f . applyAsDouble ( x1 ) ; double y2 ; for ( int ii = 1 ; ii <= points ; ii ++ ) { x1 += delta ; y2 = f . applyAsDouble ( x1 ) ; sum += ( y1 + y2 ) * delta2 ; y1 = y2 ; } return sum ; } | Returns numerical integral between x1 and x2 |
15,153 | public static DoubleBinaryOperator dx ( DoubleBinaryOperator f ) { return ( x , y ) -> { double h = x != 0.0 ? SQRT_EPSILON * x : SQRT_EPSILON ; double h2 = 2.0 * h ; double y1 = - f . applyAsDouble ( x + h2 , y ) ; double y2 = 8.0 * f . applyAsDouble ( x + h , y ) ; double y3 = - 8.0 * f . applyAsDouble ( x - h , y ) ; double y4 = f . applyAsDouble ( x - h2 , y ) ; return ( y1 + y2 + y3 + y4 ) / ( 12.0 * h ) ; } ; } | Return partial derivative x |
15,154 | public static DoubleBinaryMatrix gradient ( DoubleTransform t ) { return new DoubleBinaryMatrix ( 2 , MoreMath . dx ( t . fx ( ) ) , MoreMath . dy ( t . fx ( ) ) , MoreMath . dx ( t . fy ( ) ) , MoreMath . dy ( t . fy ( ) ) ) ; } | Returns Jacobian matrix |
15,155 | public < T > T asObject ( String string , Class < T > valueType ) { if ( string . isEmpty ( ) ) return null ; try { return ( T ) Classes . forName ( string ) ; } catch ( NoSuchBeingException e ) { log . warn ( "Class |%s| not found. Class converter force return value to null." , string ) ; return null ; } } | Return the Java class instance for given canonical name . If given string is empty returns null . If class not found warn to logger and also returns null . |
15,156 | public String asString ( Object object ) { assert object != null ; assert object instanceof Class ; return ( ( Class < ? > ) object ) . getCanonicalName ( ) ; } | Get string representation for given Java class instance . Return class canonical name . |
15,157 | public void setupDisplaySFields ( ) { new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . FORMLINK ) ; } | Controls for a display screen . |
15,158 | public void setupFields ( ) { FieldInfo field = null ; for ( int iFieldSeq = DBConstants . MAIN_FIELD ; iFieldSeq < 256 ; iFieldSeq ++ ) { field = this . setupField ( iFieldSeq ) ; if ( field == null ) break ; } } | Set up all the fields for this record . |
15,159 | public void setupKeys ( ) { KeyArea keyArea = null ; for ( int iKeyArea = DBConstants . MAIN_KEY_FIELD ; iKeyArea < 64 ; iKeyArea ++ ) { keyArea = this . setupKey ( iKeyArea ) ; if ( keyArea == null ) break ; } } | Set up all the key areas for this record . |
15,160 | public void doAddListener ( BaseListener listener ) { if ( m_listener != null ) m_listener . doAddListener ( ( FileListener ) listener ) ; else m_listener = ( FileListener ) listener ; boolean bOldState = listener . setEnabledListener ( false ) ; listener . setOwner ( this ) ; listener . setEnabledListener ( bOldState ) ; } | Internal method to add a listener to the end of the chain . Sets the listener s owner to this . |
15,161 | public void removeListener ( BaseListener theBehavior , boolean bFreeBehavior ) { if ( m_listener != null ) { if ( m_listener == theBehavior ) { m_listener = ( FileListener ) theBehavior . getNextListener ( ) ; theBehavior . unlink ( bFreeBehavior ) ; } else m_listener . removeListener ( theBehavior , bFreeBehavior ) ; } } | Remove a listener from the chain . |
15,162 | public Object [ ] setEnableNonFilter ( Object [ ] rgobjEnable , boolean bHasNext , boolean bBreak , boolean bAfterRequery , boolean bSelectEOF , boolean bFieldListeners ) { boolean bEnable = ( rgobjEnable == null ) ? false : true ; if ( bFieldListeners ) { if ( rgobjEnable == null ) rgobjEnable = this . setEnableFieldListeners ( bEnable ) ; else this . setEnableFieldListeners ( rgobjEnable ) ; } else { if ( rgobjEnable == null ) rgobjEnable = new Object [ 0 ] ; } FileListener listener = this . getListener ( ) ; int iCount = this . getFieldCount ( ) ; while ( listener != null ) { if ( ! ( listener instanceof org . jbundle . base . db . filter . FileFilter ) ) { if ( ! bEnable ) { rgobjEnable = Utility . growArray ( rgobjEnable , iCount + 1 , 8 ) ; if ( listener . isEnabledListener ( ) ) rgobjEnable [ iCount ] = Boolean . TRUE ; else rgobjEnable [ iCount ] = Boolean . FALSE ; listener . setEnabledListener ( bEnable ) ; } else { boolean bEnableThis = true ; if ( iCount < rgobjEnable . length ) if ( rgobjEnable [ iCount ] != null ) bEnableThis = ( ( Boolean ) rgobjEnable [ iCount ] ) . booleanValue ( ) ; listener . setEnabledListener ( bEnableThis ) ; } iCount ++ ; } listener = ( FileListener ) listener . getNextListener ( ) ; } if ( bEnable ) { if ( bAfterRequery ) this . handleRecordChange ( null , DBConstants . AFTER_REQUERY_TYPE , true ) ; if ( bBreak ) this . handleRecordChange ( null , DBConstants . CONTROL_BREAK_TYPE , true ) ; if ( bHasNext ) { this . handleValidRecord ( true ) ; this . handleRecordChange ( null , DBConstants . MOVE_NEXT_TYPE , true ) ; } if ( bSelectEOF ) this . handleRecordChange ( null , DBConstants . SELECT_EOF_TYPE , true ) ; if ( this . getTable ( ) . getCurrentTable ( ) . getRecord ( ) != this ) { boolean bCloneListeners = false ; boolean bMatchEnabledState = true ; boolean bSyncReferenceFields = false ; boolean bMatchSelectedState = true ; this . matchListeners ( this . getTable ( ) . getCurrentTable ( ) . getRecord ( ) , bCloneListeners , bMatchEnabledState , bSyncReferenceFields , bMatchSelectedState , true ) ; } } return rgobjEnable ; } | Enable or Disable non - filter listeners for this record . |
15,163 | public Object [ ] setEnableFieldListeners ( boolean bEnable ) { int iFieldCount = this . getFieldCount ( ) ; Object [ ] rgobjEnabledFields = new Object [ iFieldCount ] ; for ( int i = 0 ; i < iFieldCount ; i ++ ) { BaseField field = this . getField ( i ) ; rgobjEnabledFields [ i ] = field . setEnableListeners ( bEnable ) ; } return rgobjEnabledFields ; } | Enable or Disable all the field listeners and return the original state . |
15,164 | public void setEnableFieldListeners ( Object [ ] rgobjEnabledFields ) { for ( int i = 0 ; i < this . getFieldCount ( ) ; i ++ ) { this . getField ( i ) . setEnableListeners ( ( boolean [ ] ) rgobjEnabledFields [ i ] ) ; } } | Enable all the field listeners in this record according to this map . |
15,165 | public static final String formatTableNames ( String strTableNames , boolean bAddQuotes ) { if ( bAddQuotes ) if ( strTableNames . indexOf ( ' ' ) != - 1 ) strTableNames = BaseField . addQuotes ( strTableNames , DBConstants . SQL_START_QUOTE , DBConstants . SQL_END_QUOTE ) ; return strTableNames ; } | Utility routine to add quotes to a string if the string contains a space . |
15,166 | public BaseTable getTable ( ) { BaseTable table = ( BaseTable ) super . getTable ( ) ; if ( table == null ) { DatabaseOwner databaseOwner = null ; if ( this . getRecordOwner ( ) != null ) databaseOwner = this . getRecordOwner ( ) . getDatabaseOwner ( ) ; if ( databaseOwner != null ) { BaseDatabase database = ( BaseDatabase ) databaseOwner . getDatabase ( this . getDatabaseName ( ) , this . getDatabaseType ( ) , null ) ; m_table = database . makeTable ( this ) ; } } return ( BaseTable ) super . getTable ( ) ; } | Get the table for this record . This is the same as getFieldTable but casts the class up . |
15,167 | public int getFieldSeq ( String fieldName ) { for ( int i = 0 ; i < this . getFieldCount ( ) ; i ++ ) { if ( fieldName . equals ( this . getField ( i ) . getFieldName ( ) ) ) return i ; } return - 1 ; } | Get the field sequence for this field . |
15,168 | public String getDefaultScreenKeyArea ( ) { for ( int i = DBConstants . MAIN_KEY_AREA ; i < this . getKeyAreaCount ( ) ; i ++ ) { if ( this . getKeyArea ( i ) . getUniqueKeyCode ( ) == DBConstants . NOT_UNIQUE ) if ( this . getKeyArea ( i ) . getKeyField ( DBConstants . MAIN_KEY_FIELD ) . getField ( DBConstants . FILE_KEY_AREA ) instanceof StringField ) return this . getKeyArea ( i ) . getKeyName ( ) ; } return null ; } | Get the default key index for grid screens . The default key area for grid screens is the first non - unique key that is a string . Override this to supply a different key area . |
15,169 | public Record getRecord ( String strFileName ) { boolean bAddQuotes = false ; if ( strFileName . length ( ) > 0 ) if ( strFileName . charAt ( 0 ) == '\"' ) bAddQuotes = true ; if ( this . getTableNames ( bAddQuotes ) . equals ( strFileName ) ) return this ; return null ; } | Get the record with this file name . This is more usefull in the queryrecord . |
15,170 | public RecordOwner findRecordOwner ( ) { RecordOwner recordOwner = this . getRecordOwner ( ) ; if ( recordOwner instanceof org . jbundle . base . db . shared . FakeRecordOwner ) recordOwner = null ; BaseListener listener = this . getListener ( ) ; while ( ( recordOwner == null ) && ( listener != null ) ) { BaseListener listenerDep = listener . getDependentListener ( ) ; if ( listenerDep != null ) if ( listenerDep . getListenerOwner ( ) instanceof RecordOwner ) recordOwner = ( RecordOwner ) listenerDep . getListenerOwner ( ) ; listener = listener . getNextListener ( ) ; } if ( recordOwner == null ) if ( this . getTable ( ) != null ) if ( this . getTable ( ) . getDatabase ( ) != null ) if ( this . getTable ( ) . getDatabase ( ) . getDatabaseOwner ( ) instanceof Application ) { App app = ( App ) this . getTable ( ) . getDatabase ( ) . getDatabaseOwner ( ) ; if ( app . getSystemRecordOwner ( ) == null ) app = ( ( Environment ) this . getTable ( ) . getDatabase ( ) . getDatabaseOwner ( ) . getEnvironment ( ) ) . getDefaultApplication ( ) ; if ( app != null ) { if ( app . getSystemRecordOwner ( ) instanceof RecordOwner ) recordOwner = ( RecordOwner ) app . getSystemRecordOwner ( ) ; else { Environment env = ( Environment ) this . getTable ( ) . getDatabase ( ) . getDatabaseOwner ( ) . getEnvironment ( ) ; for ( int i = env . getApplicationCount ( ) - 1 ; i >= 0 ; i -- ) { app = env . getApplication ( i ) ; if ( app instanceof MainApplication ) if ( app . getSystemRecordOwner ( ) instanceof RecordOwner ) recordOwner = ( RecordOwner ) app . getSystemRecordOwner ( ) ; } } } } return recordOwner ; } | Get a recordowner from this record . This method does a deep search using the listeners and the database connections to find a recordowner . |
15,171 | public boolean isAllSelected ( ) { boolean bAllSelected = true ; for ( int iFieldSeq = DBConstants . MAIN_FIELD ; iFieldSeq <= this . getFieldCount ( ) + DBConstants . MAIN_FIELD - 1 ; iFieldSeq ++ ) { if ( this . getField ( iFieldSeq ) . isSelected ( ) == false ) bAllSelected = false ; } return bAllSelected ; } | Are all the fields selected? |
15,172 | public String getSQLQuery ( boolean bUseCurrentValues , Vector < BaseField > vParamList ) { String strRecordset = this . makeTableNames ( false ) ; String strFields = this . getSQLFields ( DBConstants . SQL_SELECT_TYPE , bUseCurrentValues ) ; boolean bIsQueryRecord = this . isQueryRecord ( ) ; String strSortParams = this . addSortParams ( bIsQueryRecord , true ) ; this . handleInitialKey ( ) ; String strStartRange = this . addSelectParams ( ">=" , DBConstants . START_SELECT_KEY , true , bIsQueryRecord , bUseCurrentValues , vParamList , true , false ) ; this . handleEndKey ( ) ; String strEndRange = this . addSelectParams ( "<=" , DBConstants . END_SELECT_KEY , true , bIsQueryRecord , bUseCurrentValues , vParamList , true , false ) ; String strWhere = DBConstants . BLANK ; if ( strStartRange . length ( ) == 0 ) strWhere = strEndRange ; else { if ( strEndRange . length ( ) == 0 ) strWhere = strStartRange ; else strWhere = strStartRange + " AND " + strEndRange ; } StringBuffer strbFilter = new StringBuffer ( ) ; this . handleRemoteCriteria ( strbFilter , bIsQueryRecord , vParamList ) ; if ( strbFilter . length ( ) > 0 ) { if ( strWhere . length ( ) == 0 ) strWhere = strbFilter . toString ( ) ; else strWhere += " AND (" + strbFilter . toString ( ) + ")" ; } if ( strWhere . length ( ) > 0 ) strWhere = " WHERE " + strWhere ; strRecordset = "SELECT" + strFields + " FROM " + strRecordset + strWhere + strSortParams ; return strRecordset ; } | Get the SQL SELECT string . |
15,173 | public String getSQLSeek ( String strSeekSign , boolean bUseCurrentValues , Vector < BaseField > vParamList ) { boolean bIsQueryRecord = this . isQueryRecord ( ) ; String strRecordset = this . makeTableNames ( false ) ; String strFields = this . getSQLFields ( DBConstants . SQL_SELECT_TYPE , bUseCurrentValues ) ; String strSortParams = this . addSortParams ( bIsQueryRecord , false ) ; KeyArea keyArea = this . getKeyArea ( - 1 ) ; keyArea . setupKeyBuffer ( null , DBConstants . TEMP_KEY_AREA ) ; String sFilter = keyArea . addSelectParams ( strSeekSign , DBConstants . TEMP_KEY_AREA , false , bIsQueryRecord , bUseCurrentValues , vParamList , false , false ) ; if ( sFilter . length ( ) > 0 ) { if ( strRecordset . indexOf ( " WHERE " ) == - 1 ) sFilter = " WHERE " + sFilter ; else sFilter = " AND " + sFilter ; } strRecordset = "SELECT" + strFields + " FROM " + strRecordset + sFilter + strSortParams ; return strRecordset ; } | Get the SQL Seek string . |
15,174 | public String getSQLUpdate ( boolean bUseCurrentValues ) { String strRecordset = this . getBaseRecord ( ) . makeTableNames ( false ) ; KeyArea keyArea = this . getBaseRecord ( ) . getKeyArea ( 0 ) ; boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea . isNull ( DBConstants . TEMP_KEY_AREA , true ) ; boolean bIsQueryRecord = this . getBaseRecord ( ) . isQueryRecord ( ) ; String sFilter = keyArea . addSelectParams ( "=" , DBConstants . TEMP_KEY_AREA , false , bIsQueryRecord , bUseCurrentKeyValues , null , true , true ) ; if ( sFilter . length ( ) > 0 ) sFilter = " WHERE " + sFilter ; String strSetValues = this . getBaseRecord ( ) . getSQLFields ( DBConstants . SQL_UPDATE_TYPE , bUseCurrentValues ) ; if ( strSetValues . length ( ) == 0 ) return null ; strRecordset = "UPDATE " + strRecordset + " SET " + strSetValues + sFilter ; return strRecordset ; } | Get the SQL Update string . UPDATE table SET field1 = value1 field2 = value2 WHERE key = value |
15,175 | public String getSQLDelete ( boolean bUseCurrentValues ) { String strRecordset = this . getBaseRecord ( ) . makeTableNames ( false ) ; KeyArea keyArea = this . getKeyArea ( 0 ) ; boolean bIsQueryRecord = this . isQueryRecord ( ) ; boolean bUseCurrentKeyValues = bUseCurrentValues ? true : keyArea . isNull ( DBConstants . TEMP_KEY_AREA , false ) ; String sFilter = "?" ; sFilter = keyArea . addSelectParams ( "=" , DBConstants . TEMP_KEY_AREA , false , bIsQueryRecord , bUseCurrentKeyValues , null , true , false ) ; if ( sFilter . length ( ) > 0 ) sFilter = " WHERE " + sFilter ; strRecordset = "DELETE FROM " + strRecordset + sFilter ; return strRecordset ; } | Get the SQL Delete string . DELETE table WHERE key = value ; |
15,176 | public void handleInitialKey ( ) { KeyArea keyArea = this . getKeyArea ( - 1 ) ; if ( keyArea == null ) return ; BaseBuffer buffer = new VectorBuffer ( null ) ; boolean [ ] rgbModified = keyArea . getModified ( ) ; boolean [ ] rgbNullable = keyArea . setNullable ( true ) ; keyArea . setupKeyBuffer ( buffer , DBConstants . FILE_KEY_AREA ) ; keyArea . zeroKeyFields ( DBConstants . START_SELECT_KEY ) ; BaseListener nextListener = this . getNextEnabledListener ( ) ; if ( nextListener != null ) ( ( FileListener ) nextListener ) . doInitialKey ( ) ; else this . doInitialKey ( ) ; keyArea . setNullable ( rgbNullable ) ; keyArea . setModified ( rgbModified ) ; keyArea . reverseKeyBuffer ( buffer , DBConstants . FILE_KEY_AREA ) ; } | The initial key position is in this record ... Save it! |
15,177 | public void handleEndKey ( ) { KeyArea keyArea = this . getKeyArea ( - 1 ) ; if ( keyArea == null ) return ; BaseBuffer buffer = new VectorBuffer ( null ) ; boolean [ ] rgbModified = keyArea . getModified ( ) ; boolean [ ] rgbNullable = keyArea . setNullable ( true ) ; keyArea . setupKeyBuffer ( buffer , DBConstants . FILE_KEY_AREA ) ; keyArea . zeroKeyFields ( DBConstants . END_SELECT_KEY ) ; BaseListener nextListener = this . getNextEnabledListener ( ) ; if ( nextListener != null ) ( ( FileListener ) nextListener ) . doEndKey ( ) ; else this . doEndKey ( ) ; keyArea . setNullable ( rgbNullable ) ; keyArea . setModified ( rgbModified ) ; keyArea . reverseKeyBuffer ( buffer , DBConstants . FILE_KEY_AREA ) ; } | The end key position is in this record ... Save it! |
15,178 | public boolean handleLocalCriteria ( StringBuffer strFilter , boolean bIncludeFileName , Vector < BaseField > vParamList ) { BaseListener nextListener = this . getNextEnabledListener ( ) ; boolean bDontSkip = true ; if ( nextListener != null ) bDontSkip = ( ( FileListener ) nextListener ) . doLocalCriteria ( strFilter , bIncludeFileName , vParamList ) ; else bDontSkip = this . doLocalCriteria ( strFilter , bIncludeFileName , vParamList ) ; if ( bDontSkip == false ) return bDontSkip ; return this . getTable ( ) . doLocalCriteria ( strFilter , bIncludeFileName , vParamList ) ; } | Check to see if this record should be skipped . Generally you use a remote criteria . |
15,179 | public boolean handleRemoteCriteria ( StringBuffer strFilter , boolean bIncludeFileName , Vector < BaseField > vParamList ) { BaseListener nextListener = this . getNextEnabledListener ( ) ; if ( nextListener != null ) return ( ( FileListener ) nextListener ) . doRemoteCriteria ( strFilter , bIncludeFileName , vParamList ) ; else return this . doRemoteCriteria ( strFilter , bIncludeFileName , vParamList ) ; } | Check to see if this record should be skipped . |
15,180 | public boolean isModified ( boolean bNonKeyOnly ) { int fieldCount = this . getFieldCount ( ) ; for ( int fieldSeq = DBConstants . MAIN_FIELD ; fieldSeq < fieldCount + DBConstants . MAIN_FIELD ; fieldSeq ++ ) { BaseField field = this . getField ( fieldSeq ) ; if ( field . isModified ( ) ) if ( ! field . isVirtual ( ) ) { boolean bSkip = false ; if ( bNonKeyOnly ) { KeyArea index = this . getKeyArea ( - 1 ) ; for ( int i = DBConstants . MAIN_KEY_FIELD ; i < index . getKeyFields ( ) ; i ++ ) { if ( field == index . getField ( i ) ) { bSkip = true ; break ; } } } if ( ! bSkip ) return true ; } } return false ; } | Have any fields Changed? |
15,181 | public void setModified ( boolean [ ] rgbModified ) { int iFieldCount = this . getFieldCount ( ) ; for ( int iFieldSeq = DBConstants . MAIN_FIELD ; iFieldSeq < iFieldCount + DBConstants . MAIN_FIELD ; iFieldSeq ++ ) { BaseField field = this . getField ( iFieldSeq ) ; if ( iFieldSeq < rgbModified . length ) field . setModified ( rgbModified [ iFieldSeq ] ) ; } } | Restore the field s modified status to this . |
15,182 | public boolean isNull ( ) { int fieldCount = this . getFieldCount ( ) ; for ( int fieldSeq = DBConstants . MAIN_FIELD ; fieldSeq < fieldCount + DBConstants . MAIN_FIELD ; fieldSeq ++ ) { BaseField field = this . getField ( fieldSeq ) ; if ( ( ! field . isNullable ( ) ) && ( field . isNull ( ) ) ) return true ; } return false ; } | Are there any null fields which can t be null? |
15,183 | public void addDependentScreen ( ScreenParent screen ) { if ( m_depScreens == null ) m_depScreens = new Vector < ScreenParent > ( ) ; m_depScreens . addElement ( screen ) ; screen . setDependentQuery ( this ) ; } | Add another screen dependent on this record . If this record is closed so is the dependent screen . |
15,184 | public void removeDependentScreen ( ScreenParent screen ) { if ( m_depScreens == null ) return ; if ( m_depScreens . contains ( screen ) ) m_depScreens . removeElement ( screen ) ; screen . setDependentQuery ( null ) ; } | Remove a dependent screen . |
15,185 | public FieldInfo getCounterField ( ) { KeyArea keyArea = this . getKeyArea ( DBConstants . MAIN_KEY_AREA ) ; if ( keyArea != null ) { BaseField fldID = keyArea . getKeyField ( DBConstants . MAIN_KEY_FIELD ) . getField ( DBConstants . FILE_KEY_AREA ) ; if ( fldID instanceof CounterField ) return ( CounterField ) fldID ; } return null ; } | Get the autosequence field if it exists . |
15,186 | public boolean moveFields ( Record recSource , ResourceBundle resource , boolean bDisplayOption , int iMoveMode , boolean bAllowFieldChange , boolean bOnlyModifiedFields , boolean bMoveModifiedState , boolean syncSelection ) { boolean bFieldsMoved = false ; for ( int iFieldSeq = 0 ; iFieldSeq < this . getFieldCount ( ) ; iFieldSeq ++ ) { BaseField fldDest = this . getField ( iFieldSeq ) ; BaseField fldSource = null ; try { if ( resource == Record . MOVE_BY_NAME ) { String strSourceField = fldDest . getFieldName ( ) ; fldSource = recSource . getField ( strSourceField ) ; } else if ( resource != null ) { String strSourceField = resource . getString ( fldDest . getFieldName ( ) ) ; if ( ( strSourceField != null ) && ( strSourceField . length ( ) > 0 ) ) fldSource = recSource . getField ( strSourceField ) ; } else { fldSource = recSource . getField ( iFieldSeq ) ; } } catch ( MissingResourceException ex ) { fldSource = null ; } if ( fldSource != null ) { if ( ( ! bOnlyModifiedFields ) || ( fldSource . isModified ( ) ) ) { boolean [ ] rgbEnabled = null ; if ( bAllowFieldChange == false ) rgbEnabled = fldDest . setEnableListeners ( bAllowFieldChange ) ; FieldDataScratchHandler listenerScratchData = null ; if ( ( bAllowFieldChange == false ) && ( bMoveModifiedState ) ) if ( iMoveMode == DBConstants . READ_MOVE ) if ( fldDest . getNextValidListener ( iMoveMode ) instanceof FieldDataScratchHandler ) ( listenerScratchData = ( ( FieldDataScratchHandler ) fldDest . getNextValidListener ( iMoveMode ) ) ) . setAlwaysEnabled ( false ) ; fldDest . moveFieldToThis ( fldSource , bDisplayOption , iMoveMode ) ; if ( listenerScratchData != null ) listenerScratchData . setAlwaysEnabled ( true ) ; if ( rgbEnabled != null ) fldDest . setEnableListeners ( rgbEnabled ) ; if ( bAllowFieldChange == false ) fldDest . setModified ( false ) ; bFieldsMoved = true ; } if ( ( bAllowFieldChange ) || ( bMoveModifiedState ) ) fldDest . setModified ( fldSource . isModified ( ) ) ; if ( syncSelection ) fldDest . setSelected ( fldSource . isSelected ( ) ) ; } } return bFieldsMoved ; } | Copy all the fields from one record to another . |
15,187 | public void selectScreenFields ( ) { if ( this . isOpen ( ) ) return ; { } Record recordBase = this . getBaseRecord ( ) ; if ( recordBase != null ) { for ( int iIndex = DBConstants . MAIN_FIELD ; iIndex < recordBase . getFieldCount ( ) ; iIndex ++ ) { boolean bSelect = false ; BaseField field = recordBase . getField ( iIndex ) ; if ( field . isVirtual ( ) ) continue ; if ( field . getComponent ( 0 ) != null ) bSelect = true ; else { FieldListener listener = field . getListener ( ) ; while ( listener != null ) { if ( listener . respondsToMode ( DBConstants . READ_MOVE ) ) { if ( ( ! field . isVirtual ( ) ) || ( listener instanceof ReadSecondaryHandler ) ) bSelect = true ; } listener = ( FieldListener ) listener . getNextListener ( ) ; } } field . setSelected ( bSelect ) ; } KeyArea keyArea = recordBase . getKeyArea ( DBConstants . MAIN_KEY_AREA ) ; int iLastIndex = keyArea . getKeyFields ( ) + DBConstants . MAIN_FIELD ; for ( int iIndexSeq = DBConstants . MAIN_FIELD ; iIndexSeq < iLastIndex ; iIndexSeq ++ ) { keyArea . getField ( iIndexSeq ) . setSelected ( true ) ; } } this . selectFields ( ) ; } | Optimize the query by only selecting the fields which are being displayed . |
15,188 | public boolean checkAndHandleFieldChanges ( BaseBuffer buffer , boolean [ ] rgbModified , boolean bRestoreVirtualFields ) { boolean bAnyChanged = false ; buffer . resetPosition ( ) ; for ( int iFieldSeq = 0 ; iFieldSeq < this . getFieldCount ( ) ; iFieldSeq ++ ) { BaseField field = this . getField ( iFieldSeq ) ; Object dataScreen = buffer . getNextData ( ) ; Object dataUpdated = field . getData ( ) ; if ( ( ( dataUpdated != null ) && ( ! dataUpdated . equals ( dataScreen ) ) ) || ( ( dataUpdated == null ) && ( dataScreen != dataUpdated ) ) || ( field . isModified ( ) ) ) { if ( ( this . getField ( iFieldSeq ) . isVirtual ( ) ) && ( ! this . getField ( iFieldSeq ) . isModified ( ) ) && ( this . getField ( iFieldSeq ) . getData ( ) == this . getField ( iFieldSeq ) . getDefault ( ) ) ) { if ( bRestoreVirtualFields ) { boolean [ ] rgbEnabled = this . getField ( iFieldSeq ) . setEnableListeners ( false ) ; this . getField ( iFieldSeq ) . setData ( dataScreen ) ; this . getField ( iFieldSeq ) . setModified ( false ) ; this . getField ( iFieldSeq ) . setEnableListeners ( rgbEnabled ) ; } } else { int iMoveMode = field . isModified ( ) ? DBConstants . SCREEN_MOVE : DBConstants . READ_MOVE ; if ( rgbModified != null ) if ( rgbModified [ iFieldSeq ] ) { iMoveMode = DBConstants . SCREEN_MOVE ; if ( field . isVirtual ( ) ) if ( ( ( dataUpdated != null ) && ( dataUpdated . equals ( dataScreen ) ) ) || ( ( dataUpdated == null ) && ( dataScreen == dataUpdated ) ) ) if ( ! field . isJustModified ( ) ) iMoveMode = DBConstants . READ_MOVE ; } this . getField ( iFieldSeq ) . handleFieldChanged ( DBConstants . DISPLAY , iMoveMode ) ; bAnyChanged = true ; } } } return bAnyChanged ; } | Compare the current state with the way the record was before and call any fieldchange listeners . |
15,189 | public int getCodeKeyArea ( ) { int iTargetKeyArea = 0 ; for ( int i = this . getKeyAreaCount ( ) - 1 ; i >= 0 ; i -- ) { KeyArea keyArea = this . getKeyArea ( i ) ; if ( keyArea . getUniqueKeyCode ( ) == DBConstants . SECONDARY_KEY ) iTargetKeyArea = i ; if ( iTargetKeyArea == 0 ) if ( keyArea . getUniqueKeyCode ( ) == DBConstants . NOT_UNIQUE ) if ( keyArea . getField ( 0 ) . getDataClass ( ) == String . class ) iTargetKeyArea = i ; } return iTargetKeyArea ; } | Get the code key area . |
15,190 | public boolean populateThinTable ( FieldList fieldList , boolean bApplyMappedFilter ) { Record record = this ; if ( bApplyMappedFilter ) record = this . applyMappedFilter ( ) ; if ( record == null ) return false ; FieldTable table = fieldList . getTable ( ) ; boolean bAutoSequence = fieldList . isAutoSequence ( ) ; boolean [ ] rgListeners = null ; Object [ ] rgFieldListeners = null ; int iOldOpenMode = fieldList . getOpenMode ( ) ; fieldList . setOpenMode ( DBConstants . OPEN_NORMAL ) ; try { fieldList . setAutoSequence ( false ) ; if ( fieldList instanceof Record ) { rgListeners = ( ( Record ) fieldList ) . setEnableListeners ( false ) ; rgFieldListeners = ( ( Record ) fieldList ) . setEnableFieldListeners ( false ) ; } while ( record . hasNext ( ) ) { record . next ( ) ; table . addNew ( ) ; if ( bApplyMappedFilter ) this . moveDataToThin ( record , fieldList ) ; else this . copyAllFields ( record , fieldList ) ; table . add ( fieldList ) ; } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } finally { fieldList . setAutoSequence ( bAutoSequence ) ; if ( rgListeners != null ) ( ( Record ) fieldList ) . setEnableListeners ( rgListeners ) ; if ( rgFieldListeners != null ) ( ( Record ) fieldList ) . setEnableFieldListeners ( rgFieldListeners ) ; fieldList . setOpenMode ( iOldOpenMode ) ; } if ( bApplyMappedFilter ) this . freeMappedRecord ( record ) ; return true ; } | Utility to copy this entire table to this thin table . |
15,191 | public final void copyAllFields ( Record record , FieldList fieldList ) { for ( int i = 0 ; i < fieldList . getFieldCount ( ) ; i ++ ) { FieldInfo fieldInfo = fieldList . getField ( i ) ; BaseField field = record . getField ( i ) ; this . moveFieldToThin ( fieldInfo , field , record ) ; } } | Copy the data in this record to the thin version . |
15,192 | public void moveFieldToThin ( FieldInfo fieldInfo , BaseField field , Record record ) { if ( ( field == null ) || ( ! field . getFieldName ( ) . equals ( fieldInfo . getFieldName ( ) ) ) ) { field = null ; if ( record != null ) field = record . getField ( fieldInfo . getFieldName ( ) ) ; } if ( field != null ) { if ( field . getDataClass ( ) == fieldInfo . getDataClass ( ) ) fieldInfo . setData ( field . getData ( ) ) ; else fieldInfo . setString ( field . toString ( ) ) ; } } | Move the data in this record to the thin version . |
15,193 | private static String [ ] tokenize ( String string ) { if ( string . indexOf ( "?" ) == - 1 && string . indexOf ( "*" ) == - 1 ) { return new String [ ] { string } ; } char [ ] textArray = string . toCharArray ( ) ; List < String > tokens = new ArrayList < String > ( ) ; StringBuilder tokenBuilder = new StringBuilder ( ) ; for ( int i = 0 ; i < textArray . length ; i ++ ) { if ( textArray [ i ] != '?' && textArray [ i ] != '*' ) { tokenBuilder . append ( textArray [ i ] ) ; continue ; } if ( tokenBuilder . length ( ) != 0 ) { tokens . add ( tokenBuilder . toString ( ) ) ; tokenBuilder . setLength ( 0 ) ; } if ( textArray [ i ] == '?' ) { tokens . add ( "?" ) ; } else if ( tokens . size ( ) == 0 || ( i > 0 && tokens . get ( tokens . size ( ) - 1 ) . equals ( "*" ) == false ) ) { tokens . add ( "*" ) ; } } if ( tokenBuilder . length ( ) != 0 ) { tokens . add ( tokenBuilder . toString ( ) ) ; } return ( String [ ] ) tokens . toArray ( new String [ tokens . size ( ) ] ) ; } | Splits a string into a number of tokens . |
15,194 | public void setProduct ( final String product ) { if ( product == null && this . product == null ) { return ; } else if ( product == null ) { removeChild ( this . product ) ; this . product = null ; } else if ( this . product == null ) { this . product = new KeyValueNode < String > ( CommonConstants . CS_PRODUCT_TITLE , product ) ; appendChild ( this . product , false ) ; } else { this . product . setValue ( product ) ; } } | Sets the name of the product that the Content Specification documents . |
15,195 | public void setVersion ( final String version ) { if ( version == null && this . version == null ) { return ; } else if ( version == null ) { removeChild ( this . version ) ; this . version = null ; } else if ( this . version == null ) { this . version = new KeyValueNode < String > ( CommonConstants . CS_VERSION_TITLE , version ) ; appendChild ( this . version , false ) ; } else { this . version . setValue ( version ) ; } } | Set the version of the product that the Content Specification documents . |
15,196 | public void setBrand ( final String brand ) { if ( brand == null && this . brand == null ) { return ; } else if ( brand == null ) { removeChild ( this . brand ) ; this . brand = null ; } else if ( this . brand == null ) { this . brand = new KeyValueNode < String > ( CommonConstants . CS_BRAND_TITLE , brand ) ; appendChild ( this . brand , false ) ; } else { this . brand . setValue ( brand ) ; } } | Set the brand of the product that the Content Specification documents . |
15,197 | public void setId ( final Integer id ) { if ( id == null && this . id == null ) { return ; } else if ( id == null ) { removeChild ( this . id ) ; this . id = null ; } else if ( this . id == null ) { this . id = new KeyValueNode < Integer > ( CommonConstants . CS_ID_TITLE , id ) ; nodes . addFirst ( this . id ) ; if ( this . id . getParent ( ) != null ) { this . id . removeParent ( ) ; } this . id . setParent ( this ) ; } else { this . id . setValue ( id ) ; } } | Sets the ID of the Content Specification . |
15,198 | public void setTitle ( final String title ) { if ( title == null && this . title == null ) { return ; } else if ( title == null ) { removeChild ( this . title ) ; this . title = null ; } else if ( this . title == null ) { this . title = new KeyValueNode < String > ( CommonConstants . CS_TITLE_TITLE , title ) ; appendChild ( this . title , false ) ; } else { this . title . setValue ( title ) ; } } | Sets the Content Specifications title . |
15,199 | public void setSubtitle ( final String subtitle ) { if ( subtitle == null && this . subtitle == null ) { return ; } else if ( subtitle == null ) { removeChild ( this . subtitle ) ; this . subtitle = null ; } else if ( this . subtitle == null ) { this . subtitle = new KeyValueNode < String > ( CommonConstants . CS_SUBTITLE_TITLE , subtitle ) ; appendChild ( this . subtitle , false ) ; } else { this . subtitle . setValue ( subtitle ) ; } } | Sets the Subtitle for the Content Specification |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.