idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
34,200
protected void _createChildren ( DocumentRootNode parentNode , SarlScript modelElement ) { if ( ! Strings . isNullOrEmpty ( modelElement . getPackage ( ) ) ) { // Create the node for the package declaration. createEStructuralFeatureNode ( parentNode , modelElement , XtendPackage . Literals . XTEND_FILE__PACKAGE , this ...
Create a node for the SARL script .
228
9
34,201
@ SuppressWarnings ( "checkstyle:cyclomaticcomplexity" ) protected void _createNode ( DocumentRootNode parentNode , XtendTypeDeclaration modelElement ) { // // The text region is set to the model element, not to the model element's name as in the // default implementation of createStructuralFeatureNode(). // The text r...
Create a node for the given feature container .
582
9
34,202
protected Image _image ( XtendMember modelElement ) { final Image img = super . _image ( modelElement ) ; return this . diagnoticDecorator . decorateImage ( img , modelElement ) ; }
Get the image for the Xtend members .
48
10
34,203
public IFormalParameterBuilder addParameter ( String name ) { IFormalParameterBuilder builder = this . parameterProvider . get ( ) ; builder . eInit ( this . sarlConstructor , name , getTypeResolutionContext ( ) ) ; return builder ; }
Add a formal parameter .
54
5
34,204
@ SuppressWarnings ( "static-method" ) protected boolean isValidResource ( IResource resource ) { return resource . isAccessible ( ) && ! resource . isHidden ( ) && ! resource . isPhantom ( ) && ! resource . isDerived ( ) ; }
Replies if the given resource could be considered for discovering an agent to be launched .
60
17
34,205
public ElementDescription searchAndSelect ( boolean showEmptySelectionError , Object ... scope ) { try { final List < ElementDescription > elements = findElements ( scope , PlatformUI . getWorkbench ( ) . getProgressService ( ) ) ; ElementDescription element = null ; if ( elements == null || elements . isEmpty ( ) ) { ...
Search the elements based on the given scope and select one . If more than one element was found the user selects interactively one .
235
26
34,206
private ElementDescription chooseElement ( List < ElementDescription > elements ) { final ElementListSelectionDialog dialog = new ElementListSelectionDialog ( getShell ( ) , new LabelProvider ( ) ) ; dialog . setElements ( elements . toArray ( ) ) ; dialog . setTitle ( MessageFormat . format ( Messages . AbstractSarlSc...
Prompts the user to select an element from the given element types .
165
15
34,207
public String getValidationDescription ( ) { final JvmOperation feature = getOperation ( ) ; String message = null ; if ( ! getDeclaredTypeParameters ( ) . isEmpty ( ) ) { message = MessageFormat . format ( Messages . CastOperatorLinkingCandidate_0 , getFeatureTypeParametersAsString ( true ) , feature . getSimpleName (...
Replies the string representation of the candidate .
164
9
34,208
private JvmAnnotationReference annotationClassRef ( Class < ? extends Annotation > type , List < ? extends JvmTypeReference > values ) { try { final JvmAnnotationReference annot = this . _annotationTypesBuilder . annotationRef ( type ) ; final JvmTypeAnnotationValue annotationValue = this . services . getTypesFactory (...
Create an annotation with classes as values .
158
8
34,209
protected void initializeLocalTypes ( GenerationContext context , JvmFeature feature , XExpression expression ) { if ( expression != null ) { int localTypeIndex = context . getLocalTypeIndex ( ) ; final TreeIterator < EObject > iterator = EcoreUtil2 . getAllNonDerivedContents ( expression , true ) ; final String nameSt...
Initialize the local class to the given expression .
212
10
34,210
protected void setBody ( JvmExecutable executable , Procedure1 < ITreeAppendable > expression ) { this . typeBuilder . setBody ( executable , expression ) ; }
Set the body of the executable .
37
7
34,211
protected final synchronized GenerationContext openContext ( EObject sarlObject , JvmDeclaredType type , final Iterable < Class < ? extends XtendMember > > supportedMemberTypes ) { assert type != null ; assert supportedMemberTypes != null ; this . sarlSignatureProvider . clear ( type ) ; final GenerationContext context...
Open the context for the generation of a SARL - specific element .
172
14
34,212
protected final void closeContext ( GenerationContext context ) { boolean runPostElements = false ; GenerationContext selectedContext = null ; synchronized ( this ) { final Iterator < GenerationContext > iterator = this . bufferedContexes . iterator ( ) ; while ( selectedContext == null && iterator . hasNext ( ) ) { fi...
Close a generation context .
274
5
34,213
protected final synchronized GenerationContext getContext ( JvmIdentifiableElement type ) { for ( final GenerationContext candidate : this . bufferedContexes ) { if ( Objects . equal ( candidate . getTypeIdentifier ( ) , type . getIdentifier ( ) ) ) { return candidate ; } } throw new GenerationContextNotFoundInternalEr...
Replies the SARL - specific generation context .
75
10
34,214
protected void appendDefaultConstructors ( XtendTypeDeclaration source , JvmGenericType target ) { final GenerationContext context = getContext ( target ) ; if ( ! context . hasConstructor ( ) ) { // Special case: if a value was not set, we cannot create implicit constructors // in order to have the issue message "The ...
Add the default constructors .
271
6
34,215
protected void initialize ( SarlSkill source , JvmGenericType inferredJvmType ) { // Issue #356: do not generate if the skill has no name. assert source != null ; assert inferredJvmType != null ; if ( Strings . isNullOrEmpty ( source . getName ( ) ) ) { return ; } // Create the generation context that is used by the ot...
Initialize the SARL skill type .
654
8
34,216
protected void initialize ( SarlCapacity source , JvmGenericType inferredJvmType ) { // Issue #356: do not generate if the capacity has no name. assert source != null ; assert inferredJvmType != null ; if ( Strings . isNullOrEmpty ( source . getName ( ) ) ) { return ; } // Create the generation context that is used by ...
Initialize the SARL capacity type .
486
8
34,217
@ SuppressWarnings ( "static-method" ) protected void initialize ( SarlSpace source , JvmGenericType inferredJvmType ) { // Issue #356: do not generate if the space has no name. assert source != null ; assert inferredJvmType != null ; if ( Strings . isNullOrEmpty ( source . getName ( ) ) ) { return ; } }
Initialize the SARL space type .
83
8
34,218
@ Override protected void transform ( XtendField source , JvmGenericType container ) { super . transform ( source , container ) ; // Override the visibility final JvmField field = ( JvmField ) this . sarlAssociations . getPrimaryJvmElement ( source ) ; setVisibility ( field , source ) ; final GenerationContext context ...
Transform the field .
172
4
34,219
protected void appendAOPMembers ( JvmGenericType featureContainerType , XtendTypeDeclaration container , GenerationContext context ) { Utils . populateInheritanceContext ( featureContainerType , context . getInheritedFinalOperations ( ) , context . getInheritedOverridableOperations ( ) , null , context . getInheritedOp...
Generate the code for the given SARL members in a agent - oriented container .
280
17
34,220
private static StringConcatenationClient toStringConcatenation ( final String ... javaCodeLines ) { return new StringConcatenationClient ( ) { @ Override protected void appendTo ( StringConcatenationClient . TargetStringConcatenation builder ) { for ( final String line : javaCodeLines ) { builder . append ( line ) ; bu...
Create a string concatenation client from a set of Java code lines .
93
15
34,221
protected void appendConstrainedImplements ( GenerationContext context , JvmGenericType owner , Class < ? > defaultJvmType , Class < ? extends XtendTypeDeclaration > defaultSarlType , List < ? extends JvmParameterizedTypeReference > implementedtypes ) { boolean explicitType = false ; for ( final JvmParameterizedTypeRef...
Generate the implemented types for the given SARL statement .
271
12
34,222
protected void appendEventGuardEvaluators ( JvmGenericType container ) { final GenerationContext context = getContext ( container ) ; if ( context != null ) { final Collection < Pair < SarlBehaviorUnit , Collection < Procedure1 < ? super ITreeAppendable > > > > allEvaluators = context . getGuardEvaluationCodes ( ) ; if...
Append the guard evaluators .
849
8
34,223
protected void appendSerialNumber ( GenerationContext context , XtendTypeDeclaration source , JvmGenericType target ) { if ( ! isAppendSerialNumbersEnable ( context ) ) { return ; } for ( final JvmField field : target . getDeclaredFields ( ) ) { if ( SERIAL_FIELD_NAME . equals ( field . getSimpleName ( ) ) ) { return ;...
Append the serial number field .
288
7
34,224
protected void appendSerialNumberIfSerializable ( GenerationContext context , XtendTypeDeclaration source , JvmGenericType target ) { if ( ! target . isInterface ( ) && this . inheritanceHelper . isSubTypeOf ( target , Serializable . class , null ) ) { appendSerialNumber ( context , source , target ) ; } }
Append the serial number field if and only if the container type is serializable .
72
17
34,225
protected void appendCloneFunction ( GenerationContext context , XtendTypeDeclaration source , JvmGenericType target ) { if ( ! isAppendCloneFunctionsEnable ( context ) ) { return ; } for ( final JvmOperation operation : target . getDeclaredOperations ( ) ) { if ( CLONE_FUNCTION_NAME . equals ( operation . getSimpleNam...
Append the clone function .
744
6
34,226
protected void appendSARLSpecificationVersion ( GenerationContext context , XtendTypeDeclaration source , JvmDeclaredType target ) { addAnnotationSafe ( target , SarlSpecification . class , SARLVersion . SPECIFICATION_RELEASE_VERSION_STRING ) ; }
Append the SARL specification version as an annotation to the given container .
62
15
34,227
protected void appendSARLElementType ( XtendTypeDeclaration source , JvmDeclaredType target ) { addAnnotationSafe ( target , SarlElementType . class , source . eClass ( ) . getClassifierID ( ) ) ; }
Append the SARL element type as an annotation to the given container .
55
15
34,228
protected JvmTypeReference skipTypeParameters ( JvmTypeReference type , Notifier context ) { final LightweightTypeReference ltr = Utils . toLightweightTypeReference ( type , this . services ) ; return ltr . getRawTypeReference ( ) . toJavaCompliantTypeReference ( ) ; }
Remove the type parameters from the given type .
65
9
34,229
@ SuppressWarnings ( "static-method" ) protected void translateAnnotationsTo ( List < JvmAnnotationReference > annotations , JvmAnnotationTarget target , Class < ? > ... exceptions ) { final Set < String > excepts = new HashSet <> ( ) ; for ( final Class < ? > type : exceptions ) { excepts . add ( type . getName ( ) ) ...
Copy the annotations except the ones given as parameters .
200
10
34,230
@ SuppressWarnings ( "static-method" ) protected List < JvmTypeParameter > getTypeParametersFor ( XtendTypeDeclaration type ) { if ( type instanceof XtendClass ) { return ( ( XtendClass ) type ) . getTypeParameters ( ) ; } if ( type instanceof XtendInterface ) { return ( ( XtendInterface ) type ) . getTypeParameters ( ...
Replies the type parameters for the given type .
102
10
34,231
protected JvmTypeReference cloneWithTypeParametersAndProxies ( JvmTypeReference type , JvmExecutable forExecutable ) { // Ensure that the executable is inside a container. Otherwise, the cloning function will fail. assert forExecutable . getDeclaringType ( ) != null ; // Get the type parameter mapping that is a consequ...
Clone the given type reference that for being link to the given executable component .
190
16
34,232
protected JvmTypeReference cloneWithProxiesFromOtherResource ( JvmTypeReference type , JvmOperation target ) { if ( type == null ) { return this . _typeReferenceBuilder . typeRef ( Void . TYPE ) ; } // Do not clone inferred types because they are not yet resolved and it is located within the current resource. if ( Infe...
Clone the given type reference that is associated to another Xtext resource .
236
15
34,233
@ SuppressWarnings ( "checkstyle:npathcomplexity" ) protected void copyNonStaticPublicJvmOperations ( JvmGenericType source , JvmGenericType target , Set < ActionPrototype > createdActions , Procedure2 < ? super JvmOperation , ? super ITreeAppendable > bodyBuilder ) { final Iterable < JvmOperation > operations = Iterab...
Copy the JVM operations from the source to the destination .
651
12
34,234
protected JvmTypeReference inferFunctionReturnType ( XExpression body ) { XExpression expr = body ; boolean stop = false ; while ( ! stop && expr instanceof XBlockExpression ) { final XBlockExpression block = ( XBlockExpression ) expr ; switch ( block . getExpressions ( ) . size ( ) ) { case 0 : expr = null ; break ; c...
Infer the function s return type .
189
8
34,235
protected JvmTypeReference inferFunctionReturnType ( XtendFunction source , JvmOperation target , JvmOperation overriddenOperation ) { // The return type is explicitly given if ( source . getReturnType ( ) != null ) { return ensureValidType ( source . eResource ( ) , source . getReturnType ( ) ) ; } // An super operati...
Infer the return type for the given source function .
249
11
34,236
@ SuppressWarnings ( "checkstyle:npathcomplexity" ) public void setFrom ( SARLConfiguration config ) { if ( this . input == null ) { this . input = config . getInput ( ) ; } if ( this . output == null ) { this . output = config . getOutput ( ) ; } if ( this . binOutput == null ) { this . binOutput = config . getBinOutp...
Set the uninitialized field with given configuration .
250
9
34,237
@ SuppressWarnings ( { "static-method" , "checkstyle:npathcomplexity" } ) @ Provides @ Singleton public SarlBatchCompiler provideSarlBatchCompiler ( Injector injector , Provider < SarlConfig > config , Provider < SARLBootClasspathProvider > defaultBootClasspath , Provider < IssueMessageFormatter > issueMessageFormater ...
Replies the SARL batch compiler .
840
8
34,238
@ SuppressWarnings ( "static-method" ) protected Visibility applyMinMaxVisibility ( Visibility visibility , MutableFieldDeclaration it , TransformationContext context ) { if ( context . findTypeGlobally ( Agent . class ) . isAssignableFrom ( it . getDeclaringType ( ) ) ) { if ( visibility . compareTo ( Visibility . PRO...
Apply the minimum and maximum visibilities to the given one .
102
12
34,239
public static < RT , T > ReflectMethod < RT , T > of ( Class < RT > receiverType , Class < T > returnType , String methodName ) { return new ReflectMethod <> ( receiverType , returnType , methodName ) ; }
Static constructor .
53
3
34,240
public T invoke ( RT receiver , Object ... arguments ) { assert receiver != null ; final Method method ; synchronized ( this ) { if ( this . method == null ) { this . method = getMethod ( receiver , arguments ) ; method = this . method ; } else { method = this . method ; } } try { return this . returnType . cast ( meth...
Invoke the method .
115
5
34,241
private static String getXtextKey ( String preferenceContainerID , String preferenceName ) { return GENERATOR_PREFERENCE_TAG + PreferenceConstants . SEPARATOR + preferenceContainerID + PreferenceConstants . SEPARATOR + preferenceName ; }
Create a preference key according to the Xtext option block standards .
55
13
34,242
public static String getPrefixedKey ( String preferenceContainerID , String preferenceName ) { return getXtextKey ( getPropertyPrefix ( preferenceContainerID ) , preferenceName ) ; }
Create a preference key .
39
5
34,243
public boolean hasProjectSpecificOptions ( String preferenceContainerID , IProject project ) { final IPreferenceStore store = getWritablePreferenceStore ( project ) ; // Compute the key String key = IS_PROJECT_SPECIFIC ; if ( preferenceContainerID != null ) { key = getPropertyPrefix ( preferenceContainerID ) + "." + IS...
Replies if the project has specific configuration for extra language generation provided by the given container .
163
18
34,244
public IProject ifSpecificConfiguration ( String preferenceContainerID , IProject project ) { if ( project != null && hasProjectSpecificOptions ( preferenceContainerID , project ) ) { return project ; } return null ; }
Filter the project according to the specific configuration .
44
9
34,245
public static boolean parseConverterPreferenceValue ( String input , Procedure2 < ? super String , ? super String > output ) { final StringTokenizer tokenizer = new StringTokenizer ( input , PREFERENCE_SEPARATOR ) ; String key = null ; boolean foundValue = false ; while ( tokenizer . hasMoreTokens ( ) ) { final String ...
Parse the given input which is the preference string representation .
125
12
34,246
private boolean markAsDeadCode ( XExpression expression ) { if ( expression instanceof XBlockExpression ) { final XBlockExpression block = ( XBlockExpression ) expression ; final EList < XExpression > expressions = block . getExpressions ( ) ; if ( ! expressions . isEmpty ( ) ) { markAsDeadCode ( expressions . get ( 0 ...
This code is copied from the super type
137
8
34,247
public void addForbiddenInjectionPrefix ( String prefix ) { if ( ! Strings . isEmpty ( prefix ) ) { final String real = prefix . endsWith ( "." ) ? prefix . substring ( 0 , prefix . length ( ) - 1 ) : prefix ; //$NON-NLS-1$ this . forbiddenInjectionPrefixes . add ( real ) ; } }
Add a prefix of typenames that should not be considered for injection overriding .
84
16
34,248
public void addForbiddenInjectionPostfixes ( String postfix ) { if ( ! Strings . isEmpty ( postfix ) ) { final String real = postfix . startsWith ( "." ) ? postfix . substring ( 1 ) : postfix ; //$NON-NLS-1$ this . forbiddenInjectionPrefixes . add ( real ) ; } }
Add a postfix of typenames that should not be considered for injection overriding .
81
17
34,249
public void addModifier ( Modifier modifier ) { if ( modifier != null ) { final String ruleName = modifier . getType ( ) ; if ( ! Strings . isEmpty ( ruleName ) ) { List < String > modifiers = this . modifiers . get ( ruleName ) ; if ( modifiers == null ) { modifiers = new ArrayList <> ( ) ; this . modifiers . put ( ru...
Add a modifier for a rule .
107
7
34,250
public void addDefaultSuper ( SuperTypeMapping mapping ) { if ( mapping != null ) { this . superTypeMapping . put ( mapping . getType ( ) , mapping . getSuper ( ) ) ; } }
Add a default super type .
46
6
34,251
public static < T > T getField ( Object obj , String string , Class < ? > clazz , Class < T > fieldType ) { try { final Field field = clazz . getDeclaredField ( string ) ; field . setAccessible ( true ) ; final Object value = field . get ( obj ) ; return fieldType . cast ( value ) ; } catch ( Exception exception ) { th...
Replies the value of the field .
92
8
34,252
public static < T > void copyFields ( Class < T > type , T dest , T source ) { Class < ? > clazz = type ; while ( clazz != null && ! Object . class . equals ( clazz ) ) { for ( final Field field : clazz . getDeclaredFields ( ) ) { if ( ! Modifier . isStatic ( field . getModifiers ( ) ) ) { field . setAccessible ( true ...
Clone the fields .
151
5
34,253
public Control createControl ( Composite parent ) { this . control = SWTFactory . createComposite ( parent , parent . getFont ( ) , 1 , 1 , GridData . FILL_HORIZONTAL ) ; final int nbColumns = this . enableSystemWideSelector ? 3 : 2 ; final Group group = SWTFactory . createGroup ( this . control , MoreObjects . firstNo...
Creates this block s control in the given control .
322
11
34,254
public void updateExternalSREButtonLabels ( ) { if ( this . enableSystemWideSelector ) { final ISREInstall wideSystemSRE = SARLRuntime . getDefaultSREInstall ( ) ; final String wideSystemSRELabel ; if ( wideSystemSRE == null ) { wideSystemSRELabel = Messages . SREConfigurationBlock_0 ; } else { wideSystemSRELabel = wid...
Update the label of the system - wide and project configuration buttons .
244
13
34,255
@ SuppressWarnings ( "checkstyle:npathcomplexity" ) public boolean selectSpecificSRE ( ISREInstall sre ) { ISREInstall theSRE = sre ; if ( theSRE == null ) { theSRE = SARLRuntime . getDefaultSREInstall ( ) ; } if ( theSRE != null ) { boolean changed = false ; final boolean oldNotify = this . notify ; try { this . notif...
Select a specific SRE .
316
6
34,256
public ISREInstall getSelectedSRE ( ) { if ( this . enableSystemWideSelector && this . systemSREButton . getSelection ( ) ) { return SARLRuntime . getDefaultSREInstall ( ) ; } if ( ! this . projectProviderFactories . isEmpty ( ) && this . projectSREButton . getSelection ( ) ) { return retreiveProjectSRE ( ) ; } return ...
Replies the selected SARL runtime environment .
99
9
34,257
public ISREInstall getSpecificSRE ( ) { final int index = this . runtimeEnvironmentCombo . getSelectionIndex ( ) ; if ( index >= 0 && index < this . runtimeEnvironments . size ( ) ) { return this . runtimeEnvironments . get ( index ) ; } return null ; }
Replies the specific SARL runtime environment .
65
9
34,258
public void updateEnableState ( ) { boolean comboEnabled = ! this . runtimeEnvironments . isEmpty ( ) ; boolean searchEnabled = true ; if ( isSystemWideDefaultSRE ( ) || isProjectSRE ( ) ) { comboEnabled = false ; searchEnabled = false ; } this . runtimeEnvironmentCombo . setEnabled ( comboEnabled ) ; this . runtimeEnv...
Update the enable state of the block .
89
8
34,259
public void initialize ( ) { // Initialize the SRE list this . runtimeEnvironments . clear ( ) ; final ISREInstall [ ] sres = SARLRuntime . getSREInstalls ( ) ; Arrays . sort ( sres , new Comparator < ISREInstall > ( ) { @ Override public int compare ( ISREInstall o1 , ISREInstall o2 ) { return o1 . getName ( ) . compa...
Initialize the block with the installed JREs . The selection and the components states are not updated by this function .
440
24
34,260
protected void handleInstalledSREsButtonSelected ( ) { PreferencesUtil . createPreferenceDialogOn ( getControl ( ) . getShell ( ) , SREsPreferencePage . ID , new String [ ] { SREsPreferencePage . ID } , null ) . open ( ) ; }
Invoked when the user want to search for a SARL runtime environment .
66
15
34,261
public IStatus validate ( ISREInstall sre ) { final IStatus status ; if ( this . enableSystemWideSelector && this . systemSREButton . getSelection ( ) ) { if ( SARLRuntime . getDefaultSREInstall ( ) == null ) { status = SARLEclipsePlugin . getDefault ( ) . createStatus ( IStatus . ERROR , Messages . SREConfigurationBlo...
Validate that the given SRE is valid in the context of the SRE configuration .
272
18
34,262
protected static void closeWelcomePage ( ) { final IIntroManager introManager = PlatformUI . getWorkbench ( ) . getIntroManager ( ) ; if ( introManager != null ) { final IIntroPart intro = introManager . getIntro ( ) ; if ( intro != null ) { introManager . closeIntro ( intro ) ; } } }
Close the welcome page .
77
5
34,263
public void destroy ( ) { // Unregister from Hazelcast layer. synchronized ( getSpaceIDsMutex ( ) ) { if ( this . internalListener != null ) { this . spaceIDs . removeDMapListener ( this . internalListener ) ; } // Delete the spaces. If this function is called, it // means that the spaces seems to have no more particip...
Destroy this repository and releaqse all the resources .
148
11
34,264
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) protected void ensureLocalSpaceDefinition ( SpaceID id , Object [ ] initializationParameters ) { synchronized ( getSpaceRepositoryMutex ( ) ) { if ( ! this . spaces . containsKey ( id ) ) { createSpaceInstance ( ( Class ) id . getSpaceSpecification ( ) , id , false , ...
Add the existing but not yet known spaces into this repository .
90
12
34,265
protected void removeLocalSpaceDefinition ( SpaceID id , boolean isLocalDestruction ) { final Space space ; synchronized ( getSpaceRepositoryMutex ( ) ) { space = this . spaces . remove ( id ) ; if ( space != null ) { this . spacesBySpec . remove ( id . getSpaceSpecification ( ) , id ) ; } } if ( space != null ) { fire...
Remove a remote space .
95
5
34,266
protected void removeLocalSpaceDefinitions ( boolean isLocalDestruction ) { List < Space > removedSpaces = null ; synchronized ( getSpaceRepositoryMutex ( ) ) { if ( ! this . spaces . isEmpty ( ) ) { removedSpaces = new ArrayList <> ( this . spaces . size ( ) ) ; final Iterator < Entry < SpaceID , Space > > iterator = ...
Remove all the remote spaces .
220
6
34,267
public < S extends io . sarl . lang . core . Space > S createSpace ( SpaceID spaceID , Class < ? extends SpaceSpecification < S > > spec , Object ... creationParams ) { synchronized ( getSpaceRepositoryMutex ( ) ) { if ( ! this . spaces . containsKey ( spaceID ) ) { return createSpaceInstance ( spec , spaceID , true , ...
Create a space .
94
4
34,268
@ SuppressWarnings ( "unchecked" ) public < S extends io . sarl . lang . core . Space > S getOrCreateSpaceWithSpec ( SpaceID spaceID , Class < ? extends SpaceSpecification < S > > spec , Object ... creationParams ) { synchronized ( getSpaceRepositoryMutex ( ) ) { final Collection < SpaceID > ispaces = this . spacesBySp...
Retrieve the first space of the given specification or create a space if none .
172
16
34,269
@ SuppressWarnings ( "unchecked" ) public < S extends io . sarl . lang . core . Space > S getOrCreateSpaceWithID ( SpaceID spaceID , Class < ? extends SpaceSpecification < S > > spec , Object ... creationParams ) { synchronized ( getSpaceRepositoryMutex ( ) ) { Space space = this . spaces . get ( spaceID ) ; if ( space...
Retrieve the first space of the given identifier or create a space if none .
124
16
34,270
public SynchronizedCollection < ? extends Space > getSpaces ( ) { synchronized ( getSpaceRepositoryMutex ( ) ) { return Collections3 . synchronizedCollection ( Collections . unmodifiableCollection ( this . spaces . values ( ) ) , getSpaceRepositoryMutex ( ) ) ; } }
Returns the collection of all spaces stored in this repository .
63
11
34,271
protected IStatus revalidate ( int ignoreCauses ) { try { setDirty ( false ) ; resolveDirtyFields ( false ) ; return getValidity ( ignoreCauses ) ; } catch ( Throwable e ) { if ( ( ignoreCauses & CODE_GENERAL ) == 0 ) { return SARLEclipsePlugin . getDefault ( ) . createStatus ( IStatus . ERROR , CODE_GENERAL , e ) ; } ...
Force the computation of the installation validity .
112
8
34,272
@ Override public void setClassPathEntries ( List < IRuntimeClasspathEntry > libraries ) { if ( isDirty ( ) ) { setDirty ( false ) ; resolveDirtyFields ( true ) ; } if ( ( libraries == null && this . classPathEntries != null ) || ( libraries != null && ( this . classPathEntries == null || libraries != this . classPathE...
Change the library locations of this ISREInstall .
163
10
34,273
protected static String formatCommandLineOption ( String name , String value ) { final StringBuilder str = new StringBuilder ( ) ; str . append ( "--" ) ; //$NON-NLS-1$ if ( ! Strings . isNullOrEmpty ( name ) ) { str . append ( name ) ; if ( ! Strings . isNullOrEmpty ( value ) ) { str . append ( "=" ) ; //$NON-NLS-1$ s...
Replies the string representation of a command - line option .
118
12
34,274
public boolean isCastOperatorLinkingEnabled ( SarlCastedExpression cast ) { final LightweightTypeReference sourceType = getStackedResolvedTypes ( ) . getReturnType ( cast . getTarget ( ) ) ; final LightweightTypeReference destinationType = getReferenceOwner ( ) . toLightweightTypeReference ( cast . getType ( ) ) ; if (...
Replies if the linking to the cast operator functions is enabled .
150
13
34,275
public List < ? extends ILinkingCandidate > getLinkingCandidates ( SarlCastedExpression cast ) { // Prepare the type resolver. final StackedResolvedTypes demandComputedTypes = pushTypes ( ) ; final AbstractTypeComputationState forked = withNonVoidExpectation ( demandComputedTypes ) ; final ForwardingResolvedTypes deman...
Compute the best candidates for the feature behind the cast operator .
572
13
34,276
protected ILinkingCandidate createCandidate ( SarlCastedExpression cast , ExpressionTypeComputationState state , IIdentifiableElementDescription description ) { return new CastOperatorLinkingCandidate ( cast , description , getSingleExpectation ( state ) , state ) ; }
Create a candidate from the given description .
61
8
34,277
@ SuppressWarnings ( "static-method" ) public void resetFeature ( SarlCastedExpression object ) { setStructuralFeature ( object , SarlPackage . Literals . SARL_CASTED_EXPRESSION__FEATURE , null ) ; setStructuralFeature ( object , SarlPackage . Literals . SARL_CASTED_EXPRESSION__RECEIVER , null ) ; setStructuralFeature ...
Reset the properties of the given feature in order to have casted expression that is not linked to an operation .
121
23
34,278
public IDocumentAutoFormatter getDocumentAutoFormatter ( ) { final IDocument document = getDocument ( ) ; if ( document instanceof IXtextDocument ) { final IDocumentAutoFormatter formatter = this . autoFormatterProvider . get ( ) ; formatter . bind ( ( IXtextDocument ) document , this . fContentFormatter ) ; return for...
Replies the document auto - formatter .
93
9
34,279
@ Pure public IExpressionBuilder getInitialValue ( ) { IExpressionBuilder exprBuilder = this . expressionProvider . get ( ) ; exprBuilder . eInit ( getSarlField ( ) , new Procedures . Procedure1 < XExpression > ( ) { public void apply ( XExpression expr ) { getSarlField ( ) . setInitialValue ( expr ) ; } } , getTypeRes...
Change the initialValue .
96
5
34,280
public void setOutlineEntryFormat ( String formatWithoutNumbers , String formatWithNumbers ) { if ( ! Strings . isEmpty ( formatWithoutNumbers ) ) { this . outlineEntryWithoutNumberFormat = formatWithoutNumbers ; } if ( ! Strings . isEmpty ( formatWithNumbers ) ) { this . outlineEntryWithNumberFormat = formatWithNumber...
Change the formats to be applied to the outline entries .
76
11
34,281
public void setOutlineDepthRange ( IntegerRange level ) { if ( level == null ) { this . outlineDepthRange = new IntegerRange ( DEFAULT_OUTLINE_TOP_LEVEL , DEFAULT_OUTLINE_TOP_LEVEL ) ; } else { this . outlineDepthRange = level ; } }
Change the level at which the titles may appear in the outline .
66
13
34,282
@ SuppressWarnings ( "static-method" ) protected ReferenceContext extractReferencableElements ( String text ) { final ReferenceContext context = new ReferenceContext ( ) ; // Visit the links and record the transformations final MutableDataSet options = new MutableDataSet ( ) ; final Parser parser = Parser . builder ( o...
Extract all the referencable objects from the given content .
356
13
34,283
protected String transformHtmlLinks ( String content , ReferenceContext references ) { if ( ! isPureHtmlReferenceTransformation ( ) ) { return content ; } // Prepare replacement data structures final Map < String , String > replacements = new TreeMap <> ( ) ; // Visit the links and record the transformations final org ...
Apply link transformation on the HTML links .
408
8
34,284
protected String transformMardownLinks ( String content , ReferenceContext references ) { if ( ! isMarkdownToHtmlReferenceTransformation ( ) ) { return content ; } // Prepare replacement data structures final Map < BasedSequence , String > replacements = new TreeMap <> ( ( cmp1 , cmp2 ) -> { final int cmp = Integer . c...
Apply link transformation on the Markdown links .
395
9
34,285
static String convertURLToString ( URL url ) { if ( URISchemeType . FILE . isURL ( url ) ) { final StringBuilder externalForm = new StringBuilder ( ) ; externalForm . append ( url . getPath ( ) ) ; final String ref = url . getRef ( ) ; if ( ! Strings . isEmpty ( ref ) ) { externalForm . append ( "#" ) . append ( ref ) ...
Convert the given URL to its string representation that is compatible with Markdown document linking mechanism .
122
19
34,286
protected URL transformURL ( URL link , ReferenceContext references ) { if ( URISchemeType . FILE . isURL ( link ) ) { File filename = FileSystem . convertURLToFile ( link ) ; if ( Strings . isEmpty ( filename . getName ( ) ) ) { // This is a link to the local document. final String anchor = transformURLAnchor ( filena...
Transform an URL from Markdown format to HTML format .
342
11
34,287
@ SuppressWarnings ( "static-method" ) protected String transformURLAnchor ( File file , String anchor , ReferenceContext references ) { String anc = anchor ; if ( references != null ) { anc = references . validateAnchor ( anc ) ; } return anc ; }
Transform the anchor of an URL from Markdown format to HTML format .
65
14
34,288
public static boolean isMarkdownFileExtension ( String extension ) { for ( final String ext : MARKDOWN_FILE_EXTENSIONS ) { if ( Strings . equal ( ext , extension ) ) { return true ; } } return false ; }
Replies if the given extension is for Markdown file .
52
12
34,289
protected void addOutlineEntry ( StringBuilder outline , int level , String sectionNumber , String title , String sectionId , boolean htmlOutput ) { if ( htmlOutput ) { indent ( outline , level - 1 , " " ) ; //$NON-NLS-1$ outline . append ( "<li><a href=\"#" ) ; //$NON-NLS-1$ outline . append ( sectionId ) ; outline . ...
Update the outline entry .
352
5
34,290
protected String formatSectionTitle ( String prefix , String sectionNumber , String title , String sectionId ) { return MessageFormat . format ( getSectionTitleFormat ( ) , prefix , sectionNumber , title , sectionId ) + "\n" ; //$NON-NLS-1$ }
Format the section title .
60
5
34,291
protected static void indent ( StringBuilder buffer , int number , String character ) { for ( int i = 0 ; i < number ; ++ i ) { buffer . append ( character ) ; } }
Create indentation in the given buffer .
40
8
34,292
protected static int computeLineNo ( Node node ) { final int offset = node . getStartOffset ( ) ; final BasedSequence seq = node . getDocument ( ) . getChars ( ) ; int tmpOffset = seq . endOfLine ( 0 ) ; int lineno = 1 ; while ( tmpOffset < offset ) { ++ lineno ; tmpOffset = seq . endOfLineAnyEOL ( tmpOffset + seq . eo...
Compute the number of lines for reaching the given node .
105
12
34,293
protected Iterable < DynamicValidationComponent > createValidatorComponents ( Image it , File currentFile , DynamicValidationContext context ) { final Collection < DynamicValidationComponent > components = new ArrayList <> ( ) ; if ( isLocalImageReferenceValidation ( ) ) { final int lineno = computeLineNo ( it ) ; fina...
Create a validation component for an image reference .
163
9
34,294
protected Iterable < DynamicValidationComponent > createValidatorComponents ( Link it , File currentFile , DynamicValidationContext context ) { final Collection < DynamicValidationComponent > components = new ArrayList <> ( ) ; if ( isLocalFileReferenceValidation ( ) || isRemoteReferenceValidation ( ) ) { final int lin...
Create a validation component for an hyper reference .
327
9
34,295
@ SuppressWarnings ( "static-method" ) protected DynamicValidationComponent createLocalImageValidatorComponent ( Image it , URL url , int lineno , File currentFile , DynamicValidationContext context ) { File fn = FileSystem . convertURLToFile ( url ) ; if ( ! fn . isAbsolute ( ) ) { fn = FileSystem . join ( currentFile...
Create a validation component for a reference to a local image .
197
12
34,296
@ SuppressWarnings ( "static-method" ) protected Collection < DynamicValidationComponent > createRemoteReferenceValidatorComponents ( Link it , URL url , int lineno , File currentFile , DynamicValidationContext context ) { return Collections . singleton ( new DynamicValidationComponent ( ) { @ Override public String fu...
Create a validation component for an hyper reference to a remote Internet page .
256
14
34,297
public JvmParameterizedTypeReference newTypeRef ( Notifier context , String typeName ) { JvmTypeReference typeReference ; try { typeReference = findType ( context , typeName ) ; getImportManager ( ) . addImportFor ( typeReference . getType ( ) ) ; return ( JvmParameterizedTypeReference ) typeReference ; } catch ( TypeN...
Replies the type reference for the given name in the given context .
391
14
34,298
@ Pure protected boolean isSubTypeOf ( EObject context , JvmTypeReference subType , JvmTypeReference superType ) { if ( isTypeReference ( superType ) && isTypeReference ( subType ) ) { StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner ( services , context ) ; LightweightTypeReferenceFactory factory = ne...
Replies if the first parameter is a subtype of the second parameter .
122
15
34,299
@ Pure protected boolean isTypeReference ( JvmTypeReference typeReference ) { return ( typeReference != null && ! typeReference . eIsProxy ( ) && typeReference . getType ( ) != null && ! typeReference . getType ( ) . eIsProxy ( ) ) ; }
Replies if the given object is a valid type reference .
60
12