idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
8,200
public boolean hasAncestor ( ElementBase element ) { ElementBase child = this ; while ( child != null ) { if ( element . hasChild ( child ) ) { return true ; } child = child . getParent ( ) ; } return false ; }
Returns true if specified element is an ancestor of this element .
54
12
8,201
public void moveChild ( int from , int to ) { if ( from != to ) { ElementBase child = children . get ( from ) ; ElementBase ref = children . get ( to ) ; children . remove ( from ) ; to = children . indexOf ( ref ) ; children . add ( to , child ) ; afterMoveChild ( child , ref ) ; } }
Moves a child from one position to another under the same parent .
78
14
8,202
public void setIndex ( int index ) { ElementBase parent = getParent ( ) ; if ( parent == null ) { CWFException . raise ( "Element has no parent." ) ; } int currentIndex = parent . children . indexOf ( this ) ; if ( currentIndex < 0 || currentIndex == index ) { return ; } parent . moveChild ( currentIndex , index ) ; }
Sets this element s index to the specified value . This effectively changes the position of the element relative to its siblings .
82
24
8,203
protected void moveChild ( BaseUIComponent child , BaseUIComponent before ) { child . getParent ( ) . addChild ( child , before ) ; }
Moves a child to before another component .
36
9
8,204
public boolean canAcceptChild ( ) { if ( maxChildren == 0 ) { rejectReason = getDisplayName ( ) + " does not accept any children." ; } else if ( getChildCount ( ) >= maxChildren ) { rejectReason = "Maximum child count exceeded for " + getDisplayName ( ) + "." ; } else { rejectReason = null ; } return rejectReason == nu...
Returns true if this element may accept a child . Updates the reject reason with the result .
83
18
8,205
public boolean canAcceptChild ( Class < ? extends ElementBase > childClass ) { if ( ! canAcceptChild ( ) ) { return false ; } Cardinality cardinality = allowedChildClasses . getCardinality ( getClass ( ) , childClass ) ; int max = cardinality . getMaxOccurrences ( ) ; if ( max == 0 ) { rejectReason = getDisplayName ( )...
Returns true if this element may accept a child of the specified class . Updates the reject reason with the result .
183
22
8,206
public boolean canAcceptParent ( Class < ? extends ElementBase > clazz ) { if ( ! canAcceptParent ( getClass ( ) , clazz ) ) { rejectReason = getDisplayName ( ) + " does not accept " + clazz . getSimpleName ( ) + " as a parent." ; } else { rejectReason = null ; } return rejectReason == null ; }
Returns true if this element may accept a parent of the specified class . Updates the reject reason with the result .
80
22
8,207
public boolean canAcceptParent ( ElementBase parent ) { if ( ! canAcceptParent ( ) ) { return false ; } if ( ! canAcceptParent ( getClass ( ) , parent . getClass ( ) ) ) { rejectReason = getDisplayName ( ) + " does not accept " + parent . getDisplayName ( ) + " as a parent." ; } else { rejectReason = null ; } return re...
Returns true if this element may accept the specified element as a parent . Updates the reject reason with the result .
91
22
8,208
public ElementBase getRoot ( ) { ElementBase root = this ; while ( root . getParent ( ) != null ) { root = root . getParent ( ) ; } return root ; }
Returns the UI element at the root of the component tree .
40
12
8,209
@ SuppressWarnings ( "unchecked" ) public < T extends ElementBase > T getAncestor ( Class < T > clazz ) { ElementBase parent = getParent ( ) ; while ( parent != null && ! clazz . isInstance ( parent ) ) { parent = parent . getParent ( ) ; } return ( T ) parent ; }
Returns the first ancestor corresponding to the specified class .
76
10
8,210
private void processResources ( boolean register ) { CareWebShell shell = CareWebUtil . getShell ( ) ; for ( IPluginResource resource : getDefinition ( ) . getResources ( ) ) { resource . register ( shell , this , register ) ; } }
Process all associated resources .
55
5
8,211
public void notifyParent ( String eventName , Object eventData , boolean recurse ) { ElementBase ele = parent ; while ( ele != null ) { recurse &= ele . parentListeners . notify ( this , eventName , eventData ) ; ele = recurse ? ele . parent : null ; } }
Allows a child element to notify its parent of an event of interest .
65
14
8,212
public void notifyChildren ( String eventName , Object eventData , boolean recurse ) { notifyChildren ( this , eventName , eventData , recurse ) ; }
Allows a parent element to notify its children of an event of interest .
34
14
8,213
private static IInfoPanel searchChildren ( ElementBase parent , ElementBase exclude , boolean activeOnly ) { IInfoPanel infoPanel = null ; if ( parent != null ) { for ( ElementBase child : parent . getChildren ( ) ) { if ( ( child != exclude ) && ( ( infoPanel = getInfoPanel ( child , activeOnly ) ) != null ) ) { break...
Search children of the specified parent for an occurrence of an active info panel . This is a recursive breadth - first search of the component tree .
144
28
8,214
private static IInfoPanel getInfoPanel ( ElementBase element , boolean activeOnly ) { if ( element instanceof ElementPlugin ) { ElementPlugin plugin = ( ElementPlugin ) element ; if ( ( ! activeOnly || plugin . isActivated ( ) ) && ( plugin . getDefinition ( ) . getId ( ) . equals ( "infoPanelPlugin" ) ) ) { plugin . l...
Returns the info panel associated with the UI element if there is one .
128
14
8,215
public static void associateEvent ( BaseComponent component , String eventName , Action action ) { getActionListeners ( component , true ) . add ( new ActionListener ( eventName , action ) ) ; }
Associate a generic event with an action on this component s container .
42
14
8,216
private static List < ActionListener > getActionListeners ( BaseComponent component , boolean forceCreate ) { @ SuppressWarnings ( "unchecked" ) List < ActionListener > ActionListeners = ( List < ActionListener > ) component . getAttribute ( EVENT_LISTENER_ATTR ) ; if ( ActionListeners == null && forceCreate ) { Action...
Returns a list of events associated with a component .
114
10
8,217
@ Override public boolean validate ( XmlObject formObject , List < AuditError > errors , String formName ) { final List < String > formErrors = new ArrayList <> ( ) ; final boolean result = validateXml ( formObject , formErrors ) ; errors . addAll ( formErrors . stream ( ) . map ( validationError -> s2SErrorHandlerServ...
This method receives an XMLObject and validates it against its schema and returns the validation result . It also receives a list in which upon validation failure populates it with XPaths of the error nodes .
122
40
8,218
public Map < String , Long > resetRetryCounter ( ) { Map < String , Long > result = retryCounter . asMap ( ) ; retryCounter . clear ( ) ; return result ; }
Reset retry counter .
43
6
8,219
protected boolean _queueWithRetries ( Connection conn , IQueueMessage < ID , DATA > msg , int numRetries , int maxRetries ) { try { Date now = new Date ( ) ; msg . setNumRequeues ( 0 ) . setQueueTimestamp ( now ) . setTimestamp ( now ) ; return putToQueueStorage ( conn , msg ) ; } catch ( DuplicatedValueException dve )...
Queue a message retry if deadlock .
265
9
8,220
protected boolean _requeueWithRetries ( Connection conn , IQueueMessage < ID , DATA > msg , int numRetries , int maxRetries ) { try { jdbcHelper . startTransaction ( conn ) ; conn . setTransactionIsolation ( transactionIsolationLevel ) ; if ( ! isEphemeralDisabled ( ) ) { removeFromEphemeralStorage ( conn , msg ) ; } D...
Re - queue a message retry if deadlock .
413
11
8,221
protected void _finishWithRetries ( Connection conn , IQueueMessage < ID , DATA > msg , int numRetries , int maxRetries ) { try { if ( ! isEphemeralDisabled ( ) ) { removeFromEphemeralStorage ( conn , msg ) ; } } catch ( DaoException de ) { if ( de . getCause ( ) instanceof ConcurrencyFailureException ) { if ( numRetri...
Perform finish action retry if deadlock .
182
10
8,222
protected IQueueMessage < ID , DATA > _takeWithRetries ( Connection conn , int numRetries , int maxRetries ) { try { jdbcHelper . startTransaction ( conn ) ; conn . setTransactionIsolation ( transactionIsolationLevel ) ; boolean result = true ; IQueueMessage < ID , DATA > msg = readFromQueueStorage ( conn ) ; if ( msg ...
Take a message from queue retry if deadlock .
388
11
8,223
private void setQuestionnareAnswerForResearchTrainingPlan ( ResearchTrainingPlan researchTrainingPlan ) { researchTrainingPlan . setHumanSubjectsIndefinite ( YesNoDataType . N_NO ) ; researchTrainingPlan . setVertebrateAnimalsIndefinite ( YesNoDataType . N_NO ) ; researchTrainingPlan . setHumanSubjectsIndefinite ( YesN...
This method is used to set QuestionnareAnswer data to ResearchTrainingPlan XMLObject
463
17
8,224
private String transformKey ( String key , String src , String tgt ) { StringBuilder sb = new StringBuilder ( ) ; String [ ] srcTokens = src . split ( WILDCARD_DELIM_REGEX ) ; String [ ] tgtTokens = tgt . split ( WILDCARD_DELIM_REGEX ) ; int len = Math . max ( srcTokens . length , tgtTokens . length ) ; int pos = 0 ; i...
Uses the source and target wildcard masks to transform an input key .
273
15
8,225
@ Override protected void afterMoveChild ( ElementBase child , ElementBase before ) { ElementTreePane childpane = ( ElementTreePane ) child ; ElementTreePane beforepane = ( ElementTreePane ) before ; moveChild ( childpane . getNode ( ) , beforepane . getNode ( ) ) ; }
Only the node needs to be resequenced since pane sequencing is arbitrary .
73
15
8,226
public void setSelectionStyle ( ThemeUtil . ButtonStyle selectionStyle ) { if ( activePane != null ) { activePane . updateSelectionStyle ( this . selectionStyle , selectionStyle ) ; } this . selectionStyle = selectionStyle ; }
Sets the button style to use for selected nodes .
54
11
8,227
@ Override protected void afterRemoveChild ( ElementBase child ) { if ( child == activePane ) { setActivePane ( ( ElementTreePane ) getFirstChild ( ) ) ; } super . afterRemoveChild ( child ) ; }
Remove the associated tree node when a tree pane is removed .
52
12
8,228
@ Override public void activateChildren ( boolean activate ) { if ( activePane == null || ! activePane . isVisible ( ) ) { ElementBase active = getFirstVisibleChild ( ) ; setActivePane ( ( ElementTreePane ) active ) ; } if ( activePane != null ) { activePane . activate ( activate ) ; } }
Only the active pane should receive the activation request .
79
10
8,229
protected void setActivePane ( ElementTreePane pane ) { if ( pane == activePane ) { return ; } if ( activePane != null ) { activePane . makeActivePane ( false ) ; } activePane = pane ; if ( activePane != null ) { activePane . makeActivePane ( true ) ; } }
Activates the specified pane . Any previously active pane will be deactivated .
77
15
8,230
@ Override public AliasType get ( String key ) { key = key . toUpperCase ( ) ; AliasType type = super . get ( key ) ; if ( type == null ) { register ( type = new AliasType ( key ) ) ; } return type ; }
Returns the AliasType given the key creating and registering it if it does not already exist .
61
19
8,231
@ Override public void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { if ( StringUtils . isEmpty ( propertyFile ) ) { return ; } for ( String pf : propertyFile . split ( "\\," ) ) { loadAliases ( applicationContext , pf ) ; } if ( fileCount > 0 ) { log . info ( "Loaded " + entry...
Loads aliases defined in an external property file if specified .
99
12
8,232
private void loadAliases ( ApplicationContext applicationContext , String propertyFile ) { if ( propertyFile . isEmpty ( ) ) { return ; } Resource [ ] resources ; try { resources = applicationContext . getResources ( propertyFile ) ; } catch ( IOException e ) { log . error ( "Failed to locate alias property file: " + p...
Load aliases from a property file .
276
7
8,233
private void register ( String key , String alias ) { String [ ] pcs = key . split ( PREFIX_DELIM_REGEX , 2 ) ; if ( pcs . length != 2 ) { throw new IllegalArgumentException ( "Illegal key value: " + key ) ; } register ( pcs [ 0 ] , pcs [ 1 ] , alias ) ; }
Registers an alias for a key prefixed with an alias type .
81
14
8,234
public static < T1 extends Comparable < T1 > , T2 extends Comparable < T2 > > Comparator < Pair < T1 , T2 > > naturalOrder ( ) { return new Comparator < Pair < T1 , T2 > > ( ) { @ Override public int compare ( Pair < T1 , T2 > lhs , Pair < T1 , T2 > rhs ) { return compareTo ( lhs , rhs ) ; } } ; }
creates a natural order for pairs of comparable things
102
10
8,235
protected AttachedFileDataType [ ] getAppendixAttachedFileDataTypes ( ) { return pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) . stream ( ) . filter ( narrative -> narrative . getNarrativeType ( ) . getCode ( ) != null && Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) == APPENDIX ) . map...
This method is used to get List of appendix attachments from NarrativeAttachment
120
15
8,236
public Document nodeToDom ( org . w3c . dom . Node node ) throws S2SException { try { javax . xml . transform . TransformerFactory tf = javax . xml . transform . TransformerFactory . newInstance ( ) ; javax . xml . transform . Transformer xf = tf . newTransformer ( ) ; javax . xml . transform . dom . DOMResult dr = new...
This method convert node of form in to a Document
176
10
8,237
public Document stringToDom ( String xmlSource ) throws S2SException { try { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; return builder . parse ( new InputSource ( new StringReader ( xmlSo...
This method convert xml string in to a Document
110
9
8,238
public String docToString ( Document node ) throws S2SException { try { DOMSource domSource = new DOMSource ( node ) ; StringWriter writer = new StringWriter ( ) ; StreamResult result = new StreamResult ( writer ) ; TransformerFactory tf = TransformerFactory . newInstance ( ) ; Transformer transformer = tf . newTransfo...
This method convert Document to a String
120
7
8,239
protected void addSubAwdAttachments ( BudgetSubAwardsContract budgetSubAwards ) { List < ? extends BudgetSubAwardAttachmentContract > subAwardAttachments = budgetSubAwards . getBudgetSubAwardAttachments ( ) ; for ( BudgetSubAwardAttachmentContract budgetSubAwardAttachment : subAwardAttachments ) { AttachmentData attach...
Adding attachments to subaward
179
6
8,240
@ SuppressWarnings ( "unchecked" ) private List < BudgetSubAwardsContract > findBudgetSubawards ( String namespace , BudgetContract budget , boolean checkNull ) { List < BudgetSubAwardsContract > budgetSubAwardsList = new ArrayList <> ( ) ; for ( BudgetSubAwardsContract subAwards : budget . getBudgetSubAwards ( ) ) { i...
This method is to find the subaward budget BOs for the given namespace .
154
17
8,241
public static PerformanceMetrics createNew ( String action , String descriptor , String correlationId ) { return new PerformanceMetrics ( KEY_GEN . getAndIncrement ( ) , 0 , action , null , descriptor , correlationId ) ; }
Creates new instance of performance metrics . Generates new metrics key and assigns zero level .
49
18
8,242
public Action0 getStartAction ( ) { return new Action0 ( ) { @ Override public void call ( ) { if ( startTime == null ) { startTime = new Date ( ) . getTime ( ) ; } } } ; }
When called start action sets time stamp to identify start time of operation .
51
14
8,243
public static Path createTempFolder ( String prefix ) throws IOException { Path parent = Paths . get ( System . getProperty ( "java.io.tmpdir" ) ) ; if ( ! Files . isDirectory ( parent ) ) { throw new IOException ( "java.io.tmpdir points to a non-existing folder: " + parent ) ; } Path ret = null ; int i = 0 ; do { ret ...
Creates a temporary folder .
188
6
8,244
public static void deleteRecursive ( Path start , boolean deleteStart ) throws IOException { Files . walkFileTree ( start , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( Path file , BasicFileAttributes attrs ) throws IOException { Files . delete ( file ) ; return FileVisitResult . C...
Deletes files and folders at the specified path .
155
10
8,245
@ Override public void afterInitialized ( BaseComponent comp ) { super . afterInitialized ( comp ) ; propertyGrid = PropertyGrid . create ( null , comp , true ) ; getPlugin ( ) . registerProperties ( this , "provider" , "group" ) ; }
Connects an embedded instance of the property grid to the plug - in s root component .
58
18
8,246
public void setProvider ( String beanId ) { provider = getAppContext ( ) . getBean ( beanId , ISettingsProvider . class ) ; providerBeanId = beanId ; init ( ) ; }
Sets the id of the bean that implements the ISettingsProvider interface .
45
15
8,247
private void init ( ) { if ( provider != null ) { propertyGrid . setTarget ( StringUtils . isEmpty ( groupId ) ? null : new Settings ( groupId , provider ) ) ; } }
Activates the property grid once the provider and group ids are set .
44
15
8,248
private void addCollectionProviderFixtureType ( Class < ? > clazz , List < FixtureType > listFixtureType , Set < Method > methods ) { for ( Method method : methods ) { if ( Collection . class . isAssignableFrom ( method . getReturnType ( ) ) ) { FixtureType fixtureType = new FixtureType ( ) ; if ( method . isAnnotation...
Parsing des FixtureCollection .
589
8
8,249
public void unbind ( BaseUIComponent component ) { if ( componentBindings . remove ( component ) ) { keyEventListener . registerComponent ( component , false ) ; CommandUtil . updateShortcuts ( component , shortcutBindings , true ) ; setCommandTarget ( component , null ) ; } }
Unbind a component from this command .
65
8
8,250
private void shortcutChanged ( String shortcut , boolean unbind ) { Set < String > bindings = new HashSet <> ( ) ; bindings . add ( shortcut ) ; for ( BaseUIComponent component : componentBindings ) { CommandUtil . updateShortcuts ( component , bindings , unbind ) ; } }
Called when a shortcut is bound or unbound .
66
11
8,251
private void setCommandTarget ( BaseComponent component , BaseComponent commandTarget ) { if ( commandTarget == null ) { commandTarget = ( BaseComponent ) component . removeAttribute ( getTargetAttributeName ( ) ) ; if ( commandTarget != null && commandTarget . hasAttribute ( ATTR_DUMMY ) ) { commandTarget . detach ( )...
Sets or removes the command target for the specified component .
95
12
8,252
private BaseComponent getCommandTarget ( BaseComponent component ) { BaseComponent commandTarget = ( BaseComponent ) component . getAttribute ( getTargetAttributeName ( ) ) ; return commandTarget == null ? component : commandTarget ; }
Returns the command target associated with the specified component .
46
10
8,253
public static String getLocalizedId ( String id , Locale locale ) { String locstr = locale == null ? "" : ( "_" + locale . toString ( ) ) ; return id + locstr ; }
Adds locale information to a help module id .
45
9
8,254
public static String computeAttachmentHash ( byte [ ] attachment ) { byte [ ] rawDigest = MESSAGE_DIGESTER . digest ( attachment ) ; return Base64 . encode ( rawDigest ) ; }
Computes the hash of an binary attachment .
48
9
8,255
@ SuppressWarnings ( "unchecked" ) @ VisibleForTesting Map < String , Class < ? extends Service > > mapEventSources ( ) throws IOException { /* Obtains all classpath's top level classes */ ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; Set < ClassPath . ClassInfo > classes = ClassPat...
Scans whole application classpath and finds events sources
671
10
8,256
public static String getClientId ( Connection connection ) { String clientId = null ; try { clientId = connection == null ? null : connection . getClientID ( ) ; } catch ( JMSException e ) { } return clientId ; }
Returns the client id from the connection .
51
8
8,257
public static String getMessageSelector ( String eventName , IPublisherInfo publisherInfo ) { StringBuilder sb = new StringBuilder ( "(JMSType='" + eventName + "' OR JMSType LIKE '" + eventName + ".%') AND (Recipients IS NULL" ) ; if ( publisherInfo != null ) { for ( String selector : publisherInfo . getAttributes ( ) ...
Creates a message selector which considers JMSType and recipients properties .
123
14
8,258
private static void addRecipientSelector ( String value , StringBuilder sb ) { if ( value != null ) { sb . append ( " OR Recipients LIKE '%," ) . append ( value ) . append ( ",%'" ) ; } }
Add a recipient selector for the given value .
55
9
8,259
private HttpHandler getAggregationHandler ( ) throws ServletException { DeploymentInfo deploymentInfo = Servlets . deployment ( ) . setClassLoader ( JashingServer . class . getClassLoader ( ) ) . setContextPath ( "/" ) . setDeploymentName ( "jashing" ) . addFilterUrlMapping ( "wro4j" , "/*" , DispatcherType . REQUEST )...
Uses Wro4j Filter to pre - process resources Required for coffee scripts compilation and saas processing Wro4j uses Servlet API so we make fake Servlet Deployment here to emulate servlet - based environment
235
45
8,260
public static String [ ] loadLibFiles ( String fileSuffix , String ... libAbsoluteClassPaths ) { Set < String > failedDllPaths = new HashSet < String > ( ) ; for ( String libAbsoluteClassPath : libAbsoluteClassPaths ) { String libraryName = libAbsoluteClassPath . substring ( libAbsoluteClassPath . lastIndexOf ( "/" ) +...
Load libraries which placed in class path .
218
8
8,261
public Cardinalities getCardinalities ( Class < ? extends ElementBase > sourceClass ) { Class < ? > clazz = sourceClass ; Cardinalities cardinalities = null ; while ( cardinalities == null && clazz != null ) { cardinalities = map . get ( clazz ) ; clazz = clazz == ElementBase . class ? null : clazz . getSuperclass ( ) ...
Returns the cardinalities associated with this class or a superclass .
88
13
8,262
private Cardinalities getOrCreateCardinalities ( Class < ? extends ElementBase > sourceClass ) { Cardinalities cardinalities = map . get ( sourceClass ) ; if ( cardinalities == null ) { map . put ( sourceClass , cardinalities = new Cardinalities ( ) ) ; } return cardinalities ; }
Returns cardinalities for the specified class creating it if necessary .
65
12
8,263
public void addCardinality ( Class < ? extends ElementBase > sourceClass , Class < ? extends ElementBase > targetClass , int maxOccurrences ) { Cardinality cardinality = new Cardinality ( sourceClass , targetClass , maxOccurrences ) ; getOrCreateCardinalities ( sourceClass ) . addCardinality ( cardinality ) ; }
Adds cardinality relationship between source and target classes .
76
10
8,264
public int getTotalCardinality ( Class < ? extends ElementBase > sourceClass ) { Cardinalities cardinalities = getCardinalities ( sourceClass ) ; return cardinalities == null ? 0 : cardinalities . total ; }
Returns the sum of cardinalities across all related classes .
47
11
8,265
public boolean isRelated ( Class < ? extends ElementBase > sourceClass , Class < ? extends ElementBase > targetClass ) { return getCardinality ( sourceClass , targetClass ) . maxOccurrences > 0 ; }
Returns true if targetClass or a superclass of targetClass is related to sourceClass .
47
18
8,266
public Cardinality getCardinality ( Class < ? extends ElementBase > sourceClass , Class < ? extends ElementBase > targetClass ) { Cardinalities cardinalities = getCardinalities ( sourceClass ) ; Cardinality cardinality = cardinalities == null ? null : cardinalities . getCardinality ( targetClass ) ; return cardinality ...
Returns the cardinality between two element classes .
90
9
8,267
@ Override public void setApplicationContext ( ApplicationContext appContext ) throws BeansException { if ( this . appContext != null ) { throw new ApplicationContextException ( "Attempt to reinitialize application context." ) ; } this . appContext = appContext ; }
ApplicationContextAware interface to allow container to inject itself . Sets the active application context .
55
18
8,268
public synchronized boolean unregisterObject ( Object object ) { int i = MiscUtil . indexOfInstance ( registeredObjects , object ) ; if ( i > - 1 ) { registeredObjects . remove ( i ) ; for ( IRegisterEvent onRegister : onRegisterList ) { onRegister . unregisterObject ( object ) ; } if ( object instanceof IRegisterEvent...
Remove an object registration from the framework and any relevant subsystems .
98
13
8,269
public synchronized Object findObject ( Class < ? > clazz , Object previousInstance ) { int i = previousInstance == null ? - 1 : MiscUtil . indexOfInstance ( registeredObjects , previousInstance ) ; for ( i ++ ; i < registeredObjects . size ( ) ; i ++ ) { Object object = registeredObjects . get ( i ) ; if ( clazz . isI...
Finds a registered object belonging to the specified class .
97
11
8,270
@ Override public Object postProcessAfterInitialization ( Object bean , String beanName ) throws BeansException { registerObject ( bean ) ; return bean ; }
Automatically registers any container - managed bean with the framework .
32
12
8,271
@ Override public void afterInitialize ( boolean deserializing ) throws Exception { super . afterInitialize ( deserializing ) ; if ( linked ) { internalDeserialize ( false ) ; } initializing = false ; }
If this is a linked layout must deserialize from it .
48
13
8,272
private void internalDeserialize ( boolean forced ) { if ( ! forced && loaded ) { return ; } lockDescendants ( false ) ; removeChildren ( ) ; loaded = true ; try { if ( linked ) { checkForCircularReference ( ) ; } getLayout ( ) . materialize ( this ) ; if ( linked ) { lockDescendants ( true ) ; } } catch ( Exception e ...
Deserialize from the associated layout .
102
8
8,273
private void checkForCircularReference ( ) { ElementLayout layout = this ; while ( ( layout = layout . getAncestor ( ElementLayout . class ) ) != null ) { if ( layout . linked && layout . shared == shared && layout . layoutName . equals ( layoutName ) ) { CWFException . raise ( "Circular reference to layout " + layoutN...
Checks for a circular reference to the same linked layout throwing an exception if found .
83
17
8,274
private void lockDescendants ( Iterable < ElementBase > children , boolean lock ) { for ( ElementBase child : children ) { child . setLocked ( lock ) ; lockDescendants ( child . getChildren ( ) , lock ) ; } }
Sets the lock state for all descendants of this layout .
52
12
8,275
public void setLinked ( boolean linked ) { if ( linked != this . linked ) { this . linked = linked ; if ( ! initializing ) { internalDeserialize ( true ) ; getRoot ( ) . activate ( true ) ; } } }
Sets the linked state . A change in this state requires reloading of the associated layout .
53
19
8,276
public static BigDecimal getSelfConfigDecimal ( String configAbsoluteClassPath , IConfigKey key ) { OneProperties configs = otherConfigs . get ( configAbsoluteClassPath ) ; if ( configs == null ) { addSelfConfigs ( configAbsoluteClassPath , null ) ; configs = otherConfigs . get ( configAbsoluteClassPath ) ; if ( config...
Get self config decimal .
120
5
8,277
public static boolean isHavePathSelfConfig ( IConfigKeyWithPath key ) { String configAbsoluteClassPath = key . getConfigPath ( ) ; return isSelfConfig ( configAbsoluteClassPath , key ) ; }
Get self config boolean value
47
5
8,278
public static void modifySystemConfig ( IConfigKey key , String value ) throws IOException { systemConfigs . modifyConfig ( key , value ) ; }
Modify one system config .
32
6
8,279
private void hostSubscribe ( String eventName , boolean subscribe ) { if ( globalEventDispatcher != null ) { try { globalEventDispatcher . subscribeRemoteEvent ( eventName , subscribe ) ; } catch ( Throwable e ) { log . error ( "Error " + ( subscribe ? "subscribing to" : "unsubscribing from" ) + " remote event '" + eve...
Registers or unregisters a subscription with the global event dispatcher if one is present .
95
18
8,280
public AbstractQueueFactory < T , ID , DATA > setDefaultObserver ( IQueueObserver < ID , DATA > defaultObserver ) { this . defaultObserver = defaultObserver ; return this ; }
Set default queue s event observer .
44
7
8,281
protected void initQueue ( T queue , QueueSpec spec ) throws Exception { queue . setObserver ( defaultObserver ) ; queue . init ( ) ; }
Initializes a newly created queue instance .
34
8
8,282
protected T createAndInitQueue ( QueueSpec spec ) throws Exception { T queue = createQueueInstance ( spec ) ; queue . setQueueName ( spec . name ) ; initQueue ( queue , spec ) ; return queue ; }
Creates & Initializes a new queue instance .
48
10
8,283
private BudgetYear1DataType getBudgetYear1DataType ( BudgetPeriodDto periodInfo ) { BudgetYear1DataType budgetYear = BudgetYear1DataType . Factory . newInstance ( ) ; budgetYear . setBudgetPeriodStartDate ( s2SDateTimeService . convertDateToCalendar ( periodInfo . getStartDate ( ) ) ) ; budgetYear . setBudgetPeriodEndD...
This method gets BudgetYear1DataType details like BudgetPeriodStartDate BudgetPeriodEndDate BudgetPeriod KeyPersons OtherPersonnel TotalCompensation Equipment ParticipantTraineeSupportCosts Travel OtherDirectCosts DirectCosts IndirectCosts CognizantFederalAgency TotalCosts and BudgetJustificationAttachment based on Bud...
622
78
8,284
private BudgetSummary getBudgetSummary ( BudgetSummaryDto budgetSummaryData ) { BudgetSummary budgetSummary = BudgetSummary . Factory . newInstance ( ) ; // Set default values for mandatory fields budgetSummary . setCumulativeTotalFundsRequestedSeniorKeyPerson ( BigDecimal . ZERO ) ; budgetSummary . setCumulativeTotalF...
This method gets BudgetSummary details such as CumulativeTotalFundsRequestedSeniorKeyPerson CumulativeTotalFundsRequestedOtherPersonnel CumulativeTotalNoOtherPersonnel CumulativeTotalFundsRequestedPersonnel CumulativeEquipments CumulativeTravels CumulativeTrainee CumulativeOtherDirect CumulativeTotalFundsRequestedDirec...
687
109
8,285
private CumulativeTravels getCumulativeTravels ( BudgetSummaryDto budgetSummaryData ) { CumulativeTravels cumulativeTravels = CumulativeTravels . Factory . newInstance ( ) ; if ( budgetSummaryData . getCumDomesticTravel ( ) != null ) { cumulativeTravels . setCumulativeDomesticTravelCosts ( budgetSummaryData . getCumDom...
This method gets CumulativeTravels details CumulativeTotalFundsRequestedTravel CumulativeDomesticTravelCosts and CumulativeForeignTravelCosts based on BudgetSummaryInfo for the RRBudget .
203
41
8,286
private OtherPersonnel getOtherPersonnel ( BudgetPeriodDto periodInfo ) { OtherPersonnel otherPersonnel = OtherPersonnel . Factory . newInstance ( ) ; int OtherpersonalCount = 0 ; List < OtherPersonnelDataType > otherPersonnelList = new ArrayList <> ( ) ; OtherPersonnelDataType otherPersonnelDataTypeArray [ ] = new Oth...
This method gets OtherPersonnel informations like PostDocAssociates GraduateStudents UndergraduateStudents SecretarialClerical based on PersonnelType and also gets NumberOfPersonnel ProjectRole Compensation OtherPersonnelTotalNumber and TotalOtherPersonnelFund based on BudgetPeriodInfo for the RRBudget .
628
61
8,287
private Travel getTravel ( BudgetPeriodDto periodInfo ) { Travel travel = Travel . Factory . newInstance ( ) ; if ( periodInfo != null ) { if ( periodInfo . getDomesticTravelCost ( ) != null ) { travel . setDomesticTravelCost ( periodInfo . getDomesticTravelCost ( ) . bigDecimalValue ( ) ) ; } if ( periodInfo . getFore...
This method gets Travel cost information including DomesticTravelCost ForeignTravelCost and TotalTravelCost in the BudgetYearDataType based on BudgetPeriodInfo for the RRBudget .
165
35
8,288
private ParticipantTraineeSupportCosts getParticipantTraineeSupportCosts ( BudgetPeriodDto periodInfo ) { ParticipantTraineeSupportCosts traineeSupportCosts = ParticipantTraineeSupportCosts . Factory . newInstance ( ) ; if ( periodInfo != null ) { traineeSupportCosts . setTuitionFeeHealthInsurance ( periodInfo . getPar...
This method gets ParticipantTraineeSupportCosts details in BudgetYearDataType such as TuitionFeeHealthInsurance Stipends Subsistence Travel Other ParticipantTraineeNumber and TotalCost based on the BudgetPeriodInfo for the RRBudget .
329
52
8,289
public static Window showXML ( Document document , BaseUIComponent parent ) { Map < String , Object > args = Collections . singletonMap ( "document" , document ) ; boolean modal = parent == null ; Window dialog = PopupDialog . show ( XMLConstants . VIEW_DIALOG , args , modal , modal , modal , null ) ; if ( parent != nu...
Show the dialog loading the specified document .
100
8
8,290
public static Window showCWF ( BaseComponent root , String ... excludedProperties ) { Window window = showXML ( CWF2XML . toDocument ( root , excludedProperties ) ) ; window . setTitle ( "CWF Markup" ) ; return window ; }
Display the CWF markup for the component tree rooted at root .
59
13
8,291
public static void setAttribute ( String key , Object value ) { assertInitialized ( ) ; getAppFramework ( ) . setAttribute ( key , value ) ; }
Stores an arbitrary named attribute in the attribute cache .
34
11
8,292
@ Override public void afterInitialized ( BaseComponent comp ) { super . afterInitialized ( comp ) ; PluginContainer container = comp . getAncestor ( PluginContainer . class , true ) ; plugin = ( ElementPlugin ) ElementUI . getAssociatedElement ( container ) ; }
Wire controller from toolbar components first then from plugin .
57
10
8,293
public void attachController ( BaseComponent comp , IAutoWired controller ) { plugin . tryRegisterListener ( controller , true ) ; comp . wireController ( controller ) ; }
Attaches a controller to the specified component and registers any recognized listeners to the plugin .
36
17
8,294
@ Override protected IAbortable removeThread ( IAbortable thread ) { super . removeThread ( thread ) ; if ( ! hasActiveThreads ( ) ) { showBusy ( null ) ; } return thread ; }
Remove a thread from the active list . Clears the busy state if this was the last active thread .
49
21
8,295
public static void bindActionListeners ( IActionTarget target , List < ActionListener > actionListeners ) { if ( actionListeners != null ) { for ( ActionListener actionListener : actionListeners ) { actionListener . bind ( target ) ; } } }
Binds the action listeners to the specified target .
55
10
8,296
public static void unbindActionListeners ( IActionTarget target , List < ActionListener > actionListeners ) { if ( actionListeners != null ) { for ( ActionListener listener : actionListeners ) { listener . unbind ( target ) ; } } }
Unbinds all action listeners from the specified target .
55
11
8,297
@ Override public void eventCallback ( String eventName , Object eventData ) { for ( IActionTarget target : new ArrayList <> ( targets ) ) { try { target . doAction ( action ) ; } catch ( Throwable t ) { } } }
This is the callback for the generic event that is monitored by this listener . It will result in the invocation of the doAction method of each bound action target .
55
32
8,298
private void bind ( IActionTarget target ) { if ( targets . isEmpty ( ) ) { getEventManager ( ) . subscribe ( eventName , this ) ; } targets . add ( target ) ; }
Binds the specified action target to this event listener .
43
11
8,299
private void unbind ( IActionTarget target ) { if ( targets . remove ( target ) && targets . isEmpty ( ) ) { getEventManager ( ) . unsubscribe ( eventName , this ) ; } }
Unbinds the specified action target from this event listener .
45
12