idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
3,600
public static StyleSheetItem create ( final StyleSheetParams styleSheetParams ) { return StyleSheetItemImpl . create ( ) . uid ( styleSheetIdGenerator . incrementAndGet ( ) ) . set ( styleSheetParams ) ; }
Build a style sheet item .
3,601
public static FXMLItem create ( final FXMLParams fxmlParams ) { return FXMLItemImpl . create ( true ) . uid ( fxmlIdGenerator . incrementAndGet ( ) ) . set ( fxmlParams ) ; }
Build a Singleton FXML item .
3,602
public static MessageItem create ( final Message messageParams ) { return MessageItemImpl . create ( ) . uid ( messageIdGenerator . incrementAndGet ( ) ) . set ( messageParams ) ; }
Build a Message item .
3,603
void initTabEventHandler ( final ToggleButton tabButton ) { try { tabButton . setOnDragDetected ( getHandler ( MouseEvent . DRAG_DETECTED ) ) ; tabButton . setOnAction ( getHandler ( ActionEvent . ACTION ) ) ; } catch ( final CoreException ce ) { LOGGER . error ( "Error while attaching event handler" , ce ) ; } }
Inits the tab event handler .
3,604
public static < D extends Object > Object buildCustomizableClass ( final ParameterItem < Class < ? > > parameter , final Class < D > defaultObject , final Class < ? > interfaceClass ) { Object object = null ; try { object = parameter . get ( ) . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessExceptio...
Build a customizable class .
3,605
private static String getThreadName ( final Type threadType ) { String threadName ; switch ( threadType ) { case NOT_RUN_INTO_JAT : threadName = "JavaFX Application Thread" ; break ; case NOT_RUN_INTO_JIT : threadName = "JRebirth Internal Thread" ; break ; case NOT_RUN_INTO_JTP : threadName = "JRebirth Thread Pool" ; b...
Return the concerned thread name .
3,606
public Object parseObject ( final ParameterEntry parameterEntry ) { Object res = null ; res = parseObjectString ( this . object . getClass ( ) , parameterEntry . getSerializedString ( ) ) ; parameterEntry . setObject ( res ) ; return res ; }
Parse the serialized object .
3,607
private Object parseObjectString ( Class < ? > objectType , final String objectString ) { Object res ; if ( ResourceParams . class . isAssignableFrom ( objectType ) ) { if ( this . object instanceof List < ? > ) { ResourceParams rp = ( ResourceParams ) ( ( List < ? > ) this . object ) . get ( 0 ) ; try { rp = ( Resourc...
Parse a string representation of an object .
3,608
private Object parseClassParameter ( final String serializedObject ) { Object res = null ; try { res = Class . forName ( serializedObject ) ; } catch ( final ClassNotFoundException e ) { throw new CoreRuntimeException ( "Impossible to load class " + serializedObject , e ) ; } return res ; }
Parse a class definition by calling Class . forName .
3,609
@ SuppressWarnings ( "unchecked" ) private Object parseEnumParameter ( final Enum < ? > e , final String serializedObject ) { final Object res = Enum . valueOf ( e . getClass ( ) , serializedObject ) ; return res ; }
Parse an Enum definition by calling Enum . valueOf .
3,610
private Object parseFileParameter ( final String serializedObject ) { final File res = new File ( serializedObject ) ; if ( ! res . exists ( ) ) { throw new CoreRuntimeException ( "Impossible to load file " + serializedObject ) ; } return res ; }
Parse a file definition by using canonical path .
3,611
private Object parseListParameter ( final String serializedObject ) { final List < Object > res = new ArrayList < > ( ) ; final Class < ? > objectType = ( ( List < ? > ) this . object ) . get ( 0 ) . getClass ( ) ; for ( final String item : serializedObject . split ( ";" ) ) { res . add ( parseObjectString ( objectType...
Parse a generic list .
3,612
private Object parsePrimitive ( Class < ? > objectType , final String serializedObject ) { Object res = null ; if ( Boolean . class . isAssignableFrom ( objectType ) ) { res = Boolean . valueOf ( serializedObject ) ; } else if ( String . class . isAssignableFrom ( objectType ) ) { res = serializedObject ; } else if ( C...
Parse primitive serialized object .
3,613
public void searchConfigurationFiles ( final String wildcard , final String extension ) { this . configurationFileWildcard = wildcard ; this . configurationFileExtension = extension ; readPropertiesFiles ( ) ; }
Search configuration files according to the parameters provided .
3,614
private void readPropertiesFile ( final String custConfFileName ) { final Properties p = new Properties ( ) ; LOGGER . log ( READ_CONF_FILE , custConfFileName ) ; try ( InputStream is = ClasspathUtility . loadInputStream ( custConfFileName ) ) { p . load ( is ) ; for ( final Map . Entry < Object , Object > entry : p . ...
Read a customized configuration file to load parameters values .
3,615
private String resolveVarEnv ( final String entryValue ) { String value = entryValue ; if ( value != null ) { value = checkPattern ( value , ENV_VAR_PATTERN1 , true ) ; value = checkPattern ( value , ENV_VAR_PATTERN2 , false ) ; } return value ; }
Resolve any environment variable found into the string .
3,616
private String checkPattern ( final String value , final Pattern pattern , final boolean withBrace ) { String res = value ; final Matcher matcher = pattern . matcher ( value ) ; while ( matcher . find ( ) ) { final String envName = matcher . group ( 2 ) ; if ( ! this . varenvMap . containsKey ( envName ) ) { final Stri...
Check if the given string contains an environment variable .
3,617
public static Cipher getCipher ( final Key key , int mode ) { try { Cipher cipher = Cipher . getInstance ( key . getAlgorithm ( ) ) ; cipher . init ( mode , key ) ; return cipher ; } catch ( NoSuchAlgorithmException | InvalidKeyException | NoSuchPaddingException e ) { throw new RuntimeException ( e ) ; } }
Creates a new Cipher
3,618
public void setNodes ( final List < ? extends Node > nodesToAdd ) { for ( final Node n : nodesToAdd ) { this . nodes . add ( n ) ; } }
Set the nodes .
3,619
void onButtonFired ( final ActionEvent event ) { final Optional < Button > b = getTarget ( event , Button . class ) ; final Optional < UniqueKey < ? extends Model > > data = getUserData ( b , StackWaves . PAGE_MODEL_KEY ) ; if ( data . isPresent ( ) ) { model ( ) . sendWave ( StackWaves . SHOW_PAGE_MODEL , WBuilder . w...
When a button is fired display the related ModuleModel .
3,620
private Font buildRealFont ( final RealFont rFont ) { checkFontStatus ( rFont ) ; return Font . font ( transformFontName ( rFont . name ( ) . name ( ) ) , rFont . size ( ) ) ; }
Build a real font with name and size .
3,621
private Font buildFamilyFont ( final FamilyFont familyFont ) { Font font = null ; if ( familyFont . posture ( ) == null && familyFont . weight ( ) == null ) { font = Font . font ( transformFontName ( familyFont . family ( ) ) , familyFont . size ( ) ) ; } else if ( familyFont . posture ( ) == null ) { font = Font . fon...
Build a Family Font with name and size .
3,622
private void checkFontStatus ( final FontParams fontParams ) { final List < String > fonts = Font . getFontNames ( transformFontName ( fontParams . name ( ) . name ( ) ) ) ; Font font = null ; String fontName = null ; if ( fonts . isEmpty ( ) ) { final List < String > fontPaths = fontParams instanceof RealFont && ( ( R...
Load the font file .
3,623
public static Swagger from ( final Swagger router , final Object ... objs ) { for ( Object o : objs ) { Processor . process ( router , o ) ; } return router ; }
Builds a Swagger from an annotated Java Object
3,624
private void checkCallbackMethods ( ) throws CoreException { for ( final EnumEventType eet : getAnnotationValue ( ) ) { final String methodName = buildHandlingMethodName ( eet ) ; final Class < ? > eventClass = getAnnotationApiEventClass ( ) ; try { this . callbackObject . getClass ( ) . getDeclaredMethod ( methodName ...
For each annotation event type check if the callback method exists .
3,625
private String buildHandlingMethodName ( final EnumEventType annotationType ) { final StringBuilder methodName = new StringBuilder ( ) ; if ( Arrays . asList ( getAnnotationValue ( ) ) . contains ( annotationType ) ) { methodName . append ( this . annotation . annotationType ( ) . getSimpleName ( ) . substring ( 0 , 1 ...
Build the handling method name used to manage this event .
3,626
private EnumEventType convertEventToEnum ( final EventType < ? extends Event > eventType ) { EnumEventType convertedType = null ; if ( getAnnotationValue ( ) != null && getAnnotationValue ( ) . length > 0 ) { final EnumEventType [ ] aTypes = getAnnotationValue ( ) [ 0 ] . getClass ( ) . getEnumConstants ( ) ; for ( int...
Convert a JavaFX event type into an annotation event type .
3,627
private void callMethod ( final String methodName , final Event event ) { final Class < ? > ctrlClass = this . callbackObject . getClass ( ) ; try { final Method method = ctrlClass . getDeclaredMethod ( methodName , event . getClass ( ) ) ; ClassUtility . callMethod ( method , this . callbackObject , event ) ; } catch ...
Call the method into the callback object .
3,628
private < T > ServiceTask < T > runTask ( final Wave sourceWave , final Method method , final Object [ ] parameterValues ) { sourceWave . addWaveListener ( new ServiceTaskWaveListener ( ) ) ; final ServiceTaskBase < T > task = new ServiceTaskBase < > ( this , method , parameterValues , sourceWave ) ; this . pendingTask...
Run the wave type method .
3,629
private void bindProgressProperty ( final ServiceTaskBase < ? > task , final DoubleProperty progressProperty ) { JRebirth . runIntoJAT ( "Bind Progress Property to " + task . getServiceHandlerName ( ) , ( ) -> { task . updateProgress ( 0 , 0 ) ; progressProperty . bind ( task . workDoneProperty ( ) . divide ( task . to...
Bind a task to a progress property to follow its progression .
3,630
private void bindProgressBar ( final ServiceTaskBase < ? > task , final ProgressBar progressBar ) { JRebirth . runIntoJAT ( "Bind ProgressBar to " + task . getServiceHandlerName ( ) , ( ) -> { task . updateProgress ( 0 , 0 ) ; progressBar . progressProperty ( ) . bind ( task . workDoneProperty ( ) . divide ( task . tot...
Bind a task to a progress bar widget to follow its progression .
3,631
private void bindTitle ( final ServiceTask < ? > task , final StringProperty titleProperty ) { JRebirth . runIntoJAT ( "Bind Title for " + task . getServiceHandlerName ( ) , ( ) -> titleProperty . bind ( task . titleProperty ( ) ) ) ; }
Bind a task to a string property that will display the task title .
3,632
private void bindMessage ( final ServiceTask < ? > task , final StringProperty messageProperty ) { JRebirth . runIntoJAT ( "Bind Message for " + task . getServiceHandlerName ( ) , ( ) -> messageProperty . bind ( task . messageProperty ( ) ) ) ; }
Bind a task to a string property that will display the task message .
3,633
public void updateProgress ( final Wave wave , final double workDone , final double totalWork , final double progressIncrement ) { if ( wave . get ( JRebirthWaves . SERVICE_TASK ) . checkProgressRatio ( workDone , totalWork , progressIncrement ) ) { JRebirth . runIntoJAT ( "ServiceTask Workdone (dbl) " + workDone + RAT...
Update the progress of the service task related to the given wave .
3,634
protected < T > Optional < T > getSource ( Event event , Class < T > type ) { return getValue ( event , event :: getSource , type ) ; }
Gets the source .
3,635
protected < T > Optional < T > getTarget ( Event event , Class < T > type ) { return getValue ( event , event :: getTarget , type ) ; }
Gets the target .
3,636
public void render ( final String file , final Map < String , Object > context , final Handler < AsyncResult < Buffer > > handler ) { read ( prefix + file , new AsyncResultHandler < String > ( ) { public void handle ( AsyncResult < String > asyncResult ) { if ( asyncResult . failed ( ) ) { handler . handle ( new YokeAs...
An interpreter for strings with named placeholders .
3,637
private void buildErrorNode ( final CoreException ce ) { final TextArea ta = TextAreaBuilder . create ( ) . text ( ce . getMessage ( ) ) . build ( ) ; this . errorNode = PaneBuilder . create ( ) . children ( ta ) . build ( ) ; }
Build the errorNode to display the error taht occured .
3,638
private void processViewAnnotation ( ) { final AutoHandler ah = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , AutoHandler . class ) ; if ( ah != null && ah . value ( ) == CallbackObject . View || controller ( ) == null ) { this . callbackObject = this ; } else { this . callbackObject = this . controller...
Process view annotation .
3,639
private void processFields ( ) throws CoreException { final Class < ? > currentClass = this . getClass ( ) ; for ( final Field f : currentClass . getDeclaredFields ( ) ) { if ( Node . class . isAssignableFrom ( f . getType ( ) ) || Animation . class . isAssignableFrom ( f . getType ( ) ) ) { boolean needToHide = false ...
Process all fields annotations to auto - link them with event handler .
3,640
private void processAnnotations ( final Field property ) throws CoreException { for ( final Annotation a : property . getAnnotations ( ) ) { if ( EventTarget . class . isAssignableFrom ( property . getType ( ) ) ) { if ( a . annotationType ( ) . getName ( ) . startsWith ( BASE_ANNOTATION_NAME ) ) { try { final EventTar...
Process all OnXxxx Annotation to attach event handler on this field .
3,641
private void addHandler ( final EventTarget target , final Annotation annotation ) throws CoreException { final AnnotationEventHandler < Event > aeh = new AnnotationEventHandler < > ( this . callbackObject , annotation ) ; for ( final EnumEventType eet : ( EnumEventType [ ] ) ClassUtility . getAnnotationAttribute ( ann...
Add an event handler on the given node according to annotation OnXxxxx .
3,642
private void addHandler ( final Animation animation , final Annotation annotation ) throws CoreException { final AnnotationEventHandler < ActionEvent > aeh = new AnnotationEventHandler < > ( this . callbackObject , annotation ) ; animation . setOnFinished ( aeh ) ; }
Add an event handler on the given animation according to annotation OnFinished .
3,643
@ SuppressWarnings ( "unchecked" ) protected C buildController ( ) throws CoreException { return ( C ) ClassUtility . findAndBuildGenericType ( this . getClass ( ) , Controller . class , NullController . class , this ) ; }
Build the view controller .
3,644
public boolean add ( final K key , final V value ) { if ( ! this . map . containsKey ( key ) ) { this . map . put ( key , new ArrayList < V > ( ) ) ; } return this . map . get ( key ) . add ( value ) ; }
Add a new entry .
3,645
public Yoke listen ( final HttpServer server ) { server . requestHandler ( new Handler < HttpServerRequest > ( ) { public void handle ( HttpServerRequest req ) { final YokeRequest request = requestWrapper . wrap ( req , new Context ( defaultContext ) , engineMap , store ) ; Boolean poweredBy = request . get ( "x-powere...
Starts listening at a already created server .
3,646
public Yoke deploy ( final JsonArray config , final Handler < Object > handler ) { if ( config . size ( ) == 0 ) { if ( handler == null ) { return this ; } else { handler . handle ( null ) ; return this ; } } Handler < AsyncResult < String > > waitFor = new Handler < AsyncResult < String > > ( ) { private int latch = c...
Deploys required middleware from a config json element . The handler is only called once all middleware is deployed or in error . The order of deployment is not guaranteed since all deploy functions are called concurrently and do not wait for the previous result before deploying the next item .
3,647
@ SuppressWarnings ( "unchecked" ) public < KP extends Object > KP getKeyPart ( final Class < KP > keyPartClass ) { return ( KP ) getListKeyPart ( ) . stream ( ) . filter ( kp -> kp != null && keyPartClass . isAssignableFrom ( kp . getClass ( ) ) ) . findFirst ( ) . get ( ) ; }
Return the first object assignable from te given class .
3,648
protected double readDouble ( final String doubleString , final double min , final double max ) { return Math . max ( Math . min ( Double . parseDouble ( doubleString ) , max ) , min ) ; }
Read a double string value .
3,649
protected int readInteger ( final String intString , final int min , final int max ) { return Math . max ( Math . min ( Integer . parseInt ( intString ) , max ) , min ) ; }
Read ab integer string value .
3,650
public void trackTask ( final ServiceTaskBase < ? > task ) { LOGGER . trace ( "track a Task" ) ; this . serviceTasks . add ( task ) ; task . setOnCancelled ( this . workerHandler ) ; task . setOnSucceeded ( this . workerHandler ) ; task . setOnFailed ( this . workerHandler ) ; }
Track a task progression .
3,651
private void addSubSlide ( final Node defaultSubSlide ) { this . subSlides . add ( model ( ) . getStepPosition ( ) , defaultSubSlide ) ; this . slideContent . getChildren ( ) . add ( defaultSubSlide ) ; StackPane . setAlignment ( defaultSubSlide , Pos . CENTER ) ; }
Add a subslide node .
3,652
protected Node getHeaderPanel ( ) { final Pane headerPane = PaneBuilder . create ( ) . styleClass ( "header" ) . layoutX ( 0.0 ) . layoutY ( 0.0 ) . minWidth ( 1024 ) . prefWidth ( 1024 ) . build ( ) ; final Label primaryTitle = LabelBuilder . create ( ) . font ( PrezFonts . SLIDE_TITLE . get ( ) ) . textFill ( PrezCol...
Build and return the header panel .
3,653
protected void bindNode ( final Node node ) { node . scaleXProperty ( ) . bind ( bindWidth ( ) ) ; node . scaleYProperty ( ) . bind ( bindHeight ( ) ) ; }
Bind node s scale properties to stage size .
3,654
protected NumberBinding bindHeight ( ) { return Bindings . divide ( model ( ) . localFacade ( ) . globalFacade ( ) . application ( ) . stage ( ) . heightProperty ( ) , 768 ) ; }
Returns the height ratio .
3,655
protected NumberBinding bindWidth ( ) { return Bindings . divide ( model ( ) . localFacade ( ) . globalFacade ( ) . application ( ) . stage ( ) . widthProperty ( ) , 1024 ) ; }
Returns the width ratio .
3,656
protected Node getFooterPanel ( ) { this . pageLabel = LabelBuilder . create ( ) . text ( String . valueOf ( model ( ) . getSlide ( ) . getPage ( ) ) ) . font ( PrezFonts . PAGE . get ( ) ) . build ( ) ; final AnchorPane ap = AnchorPaneBuilder . create ( ) . children ( this . pageLabel ) . build ( ) ; AnchorPane . setR...
Build and return the footer panel .
3,657
protected VBox buildDefaultContent ( final SlideContent slideContent ) { final VBox vbox = new VBox ( ) ; if ( model ( ) . getSlide ( ) . getStyle ( ) != null ) { vbox . getStyleClass ( ) . add ( model ( ) . getSlide ( ) . getStyle ( ) ) ; } if ( slideContent != null ) { for ( final SlideItem item : slideContent . getI...
Build the default content slide .
3,658
protected void addSlideItem ( final VBox vbox , final SlideItem item ) { Node node = null ; if ( item . isLink ( ) ) { final Hyperlink link = HyperlinkBuilder . create ( ) . opacity ( 1.0 ) . text ( item . getValue ( ) ) . build ( ) ; link . getStyleClass ( ) . add ( "link" + item . getLevel ( ) ) ; link . setOnAction ...
Add a slide item by managing level .
3,659
public void showSlideStep ( final SlideStep slideStep ) { if ( this . subSlides . size ( ) >= model ( ) . getStepPosition ( ) || this . subSlides . get ( model ( ) . getStepPosition ( ) ) == null ) { addSubSlide ( buildDefaultContent ( model ( ) . getContent ( slideStep ) ) ) ; } final Node nextSlide = this . subSlides...
Show the slide step store which match with XML file .
3,660
protected void showCustomSlideStep ( final Node node ) { addSubSlide ( node ) ; final Node nextSlide = this . subSlides . get ( model ( ) . getStepPosition ( ) ) ; if ( this . currentSubSlide == null || nextSlide == null ) { this . currentSubSlide = nextSlide ; } else { performStepAnimation ( nextSlide ) ; } }
Show a programmatic built node as a sub slide .
3,661
private void performStepAnimation ( final Node nextSlide ) { this . slideStepAnimation = ParallelTransitionBuilder . create ( ) . onFinished ( new EventHandler < ActionEvent > ( ) { public void handle ( final ActionEvent event ) { AbstractTemplateView . this . currentSubSlide = nextSlide ; } } ) . children ( Sequential...
Create an Launch the animation between two sub slides .
3,662
private void parseString ( final String eventSerialized ) { final StringTokenizer st = new StringTokenizer ( eventSerialized , ClassUtility . SEPARATOR ) ; if ( st . countTokens ( ) >= 5 ) { sequence ( Integer . parseInt ( st . nextToken ( ) ) ) . eventType ( JRebirthEventType . valueOf ( st . nextToken ( ) ) ) . sourc...
Parse the serialized string .
3,663
private Color buildHSBColor ( final HSBColor hsbColor ) { Color color = null ; if ( hsbColor . opacity ( ) >= 1.0 ) { color = Color . hsb ( hsbColor . hue ( ) , hsbColor . saturation ( ) , hsbColor . brightness ( ) ) ; } else { color = Color . hsb ( hsbColor . hue ( ) , hsbColor . saturation ( ) , hsbColor . brightness...
Build an HSB color .
3,664
private Color buildGrayColor ( final GrayColor gColor ) { Color color = null ; if ( gColor . opacity ( ) >= 1.0 ) { color = Color . gray ( gColor . gray ( ) ) ; } else { color = Color . gray ( gColor . gray ( ) , gColor . opacity ( ) ) ; } return color ; }
Build a Gray color .
3,665
private Pane buildButtonBar ( final boolean isHorizontal ) { if ( isHorizontal ) { this . box = new HBox ( ) ; this . box . setMaxWidth ( Region . USE_COMPUTED_SIZE ) ; this . box . getStyleClass ( ) . add ( "HorizontalTabbedPane" ) ; } else { this . box = new VBox ( ) ; this . box . setMaxHeight ( Region . USE_COMPUTE...
Builds the button bar .
3,666
public SequentialTransition addTab ( int idx , final Dockable tab ) { final SequentialTransition seq = new SequentialTransition ( ) ; final ToggleButton b = new ToggleButton ( tab . name ( ) ) ; b . setToggleGroup ( this . group ) ; b . setUserData ( tab ) ; final ToggleButton oldButton = this . buttonByTab . put ( tab...
Adds the tab .
3,667
void selectTab ( final Dockable t ) { this . stackPane . getChildren ( ) . clear ( ) ; this . stackPane . getChildren ( ) . add ( model ( ) . getModel ( t . modelKey ( ) ) . node ( ) ) ; }
Select tab .
3,668
public int removeMarker ( ) { System . out . println ( "Remove Marker" ) ; final int idx = getBox ( ) . getChildren ( ) . indexOf ( this . marker ) ; getBox ( ) . getChildren ( ) . remove ( this . marker ) ; return idx ; }
Removes the marker .
3,669
private void createBallModel ( final JRebirthEvent event ) { switch ( event . eventType ( ) ) { case CREATE_APPLICATION : case CREATE_NOTIFIER : case CREATE_GLOBAL_FACADE : case CREATE_COMMAND_FACADE : case CREATE_SERVICE_FACADE : case CREATE_UI_FACADE : case CREATE_COMMAND : case CREATE_SERVICE : case CREATE_MODEL : c...
Create a ballModel instance .
3,670
private void accessBallModel ( final JRebirthEvent event ) { switch ( event . eventType ( ) ) { case ACCESS_COMMAND : case ACCESS_CONTROLLER : case ACCESS_MODEL : case ACCESS_SERVICE : case ACCESS_VIEW : callCommand ( AccessBallCommand . class , WBuilder . waveData ( EditorWaves . EVENT , event ) ) ; break ; default : ...
Access to a ballModel instance .
3,671
private void destroyBallModel ( final JRebirthEvent event ) { switch ( event . eventType ( ) ) { case DESTROY_COMMAND : case DESTROY_SERVICE : case DESTROY_MODEL : case DESTROY_VIEW : case DESTROY_CONTROLLER : callCommand ( DestroyBallCommand . class , WBuilder . waveData ( EditorWaves . EVENT , event ) ) ; break ; cas...
Destroy a ball model .
3,672
private String buildObjectKey ( final Object object ) { String objectKey = null ; final Class < ? > objectClass = object . getClass ( ) ; final KeyGenerator typeGenerator = objectClass . getAnnotation ( KeyGenerator . class ) ; if ( typeGenerator == null ) { objectKey = generateAggregatedKey ( object ) ; } else { objec...
Generate the string key for an object .
3,673
private String generateTypeKey ( final Object object , final KeyGenerator typeGenerator ) { String objectKey = null ; Method method = null ; try { method = object . getClass ( ) . getMethod ( typeGenerator . value ( ) ) ; objectKey = ( String ) method . invoke ( object ) ; } catch ( final NoSuchMethodException e ) { LO...
Generate Type key by using the class - level annotation .
3,674
private String generateAggregatedKey ( final Object object ) { final StringBuilder sb = new StringBuilder ( ) ; KeyGenerator methodGenerator ; for ( final Method m : object . getClass ( ) . getMethods ( ) ) { methodGenerator = m . getAnnotation ( KeyGenerator . class ) ; if ( methodGenerator != null ) { Object returned...
Generate unique key by using the method - level annotations .
3,675
public String getTitle ( ) { return getSlide ( ) . getContent ( ) == null || getSlide ( ) . getContent ( ) . isEmpty ( ) || getSlide ( ) . getContent ( ) . get ( 0 ) . getTitle ( ) == null ? null : getSlide ( ) . getContent ( ) . get ( 0 ) . getTitle ( ) . replaceAll ( "\\\\n" , "\n" ) ; }
Return the splash title .
3,676
public String getExplanation ( ) { final StringBuilder sb = new StringBuilder ( ) ; if ( getMessage ( ) != null ) { sb . append ( getMessage ( ) ) ; } if ( getCause ( ) != null ) { sb . append ( getCause ( ) . getClass ( ) . getSimpleName ( ) ) ; } return sb . toString ( ) ; }
Return the explanation of the exception .
3,677
protected void fxmlPreInitialize ( ) { if ( ! getListKeyPart ( ) . isEmpty ( ) && getListKeyPart ( ) . get ( 0 ) instanceof FXMLItem ) { this . fxmlItem = ( FXMLItem ) getListKeyPart ( ) . get ( 0 ) ; } else if ( ! getListKeyPart ( ) . isEmpty ( ) && getListKeyPart ( ) . get ( 0 ) . toString ( ) . startsWith ( KEYPART_...
Pre init .
3,678
protected void attachParentListener ( ) { final AutoRelease ar = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , AutoRelease . class ) ; if ( ar != null && ar . value ( ) && node ( ) != null ) { node ( ) . parentProperty ( ) . addListener ( new ChangeListener < Node > ( ) { public void changed ( final Obs...
Attach a custom listener that will release the mode when the rootNode is removed from its parent .
3,679
public void onTokenRefresh ( ) { EasyGcm . Logger . d ( "Received token refresh broadcast" ) ; EasyGcm . removeRegistrationId ( getApplicationContext ( ) ) ; if ( GcmUtils . checkCanAndShouldRegister ( getApplicationContext ( ) ) ) { startService ( GcmRegistrationService . createGcmRegistrationIntent ( this ) ) ; } }
Called if InstanceID token is updated . This may occur if the security of the previous token had been compromised . This call is initiated by the InstanceID provider .
3,680
public BaseField < T > addBaseField ( int viewResId ) { BaseField < T > field = new BaseField < T > ( viewResId ) ; mBaseFields . add ( field ) ; return field ; }
Base field methods
3,681
public CheckableField < T > addCheckableField ( int viewResId , BooleanExtractor < T > isCheckedExtractor ) { CheckableField < T > field = new CheckableField < T > ( viewResId , isCheckedExtractor ) ; mCheckableFields . add ( field ) ; return field ; }
Checkable field methods
3,682
public StaticImageField < T > addStaticImageField ( int viewResId , StaticImageLoader < T > staticImageLoader ) { StaticImageField < T > field = new StaticImageField < T > ( viewResId , staticImageLoader ) ; mStaticImageFields . add ( field ) ; return field ; }
static image field methods
3,683
private void readPropertiesFile ( final String rbFilename ) { final File rbFile = new File ( rbFilename ) ; final String rbName = rbFile . getName ( ) . substring ( 0 , rbFile . getName ( ) . lastIndexOf ( ".properties" ) ) ; if ( rbName == null || rbName . isEmpty ( ) ) { LOGGER . error ( JRebirthMarkers . MESSAGE , "...
Read a customized Message file to load all translated messages .
3,684
private String findMessage ( final String messageKey ) { String message = null ; try { if ( ! this . resourceBundles . isEmpty ( ) ) { for ( int i = this . resourceBundles . size ( ) - 1 ; i >= 0 && message == null ; i -- ) { if ( this . resourceBundles . get ( i ) . containsKey ( messageKey ) ) { message = this . reso...
Retrieved the message mapped with the given key .
3,685
public static boolean equalsOrBothNull ( final Object object1 , final Object object2 ) { return object1 == null && object2 == null || object1 != null && object1 . equals ( object2 ) ; }
Return true if the object are equals or both null .
3,686
public static String lowerFirstChar ( final String upperCasedString ) { return upperCasedString . substring ( 0 , 1 ) . toLowerCase ( Locale . getDefault ( ) ) + upperCasedString . substring ( 1 ) ; }
Lower case te first char of a string .
3,687
public static boolean checkAllMethodReturnTrue ( final Object instance , final List < Method > methods ) { boolean res = true ; if ( ! methods . isEmpty ( ) ) { for ( final Method method : methods ) { Object returnValue ; try { returnValue = method . invoke ( instance ) ; res &= returnValue instanceof Boolean && ( ( Bo...
Check if all given methods return true or if the list is empty .
3,688
private ParallelTransition buildSlideTransition ( final boolean isReverse , final SlideModel < SlideStep > previousSlideModel , final SlideModel < SlideStep > selectedSlideModel ) { final ParallelTransition slideAnimation = ParallelTransitionBuilder . create ( ) . build ( ) ; if ( previousSlideModel != null ) { final A...
Get the animation to use between slides .
3,689
public void next ( final boolean skipSlideStep ) { synchronized ( this ) { if ( skipSlideStep || this . selectedSlideModel . nextStep ( ) && this . slidePosition < getPresentationService ( ) . getPresentation ( ) . getSlides ( ) . getSlide ( ) . size ( ) - 1 ) { this . slidePosition = Math . min ( this . slidePosition ...
Got to next slide .
3,690
public void previous ( final boolean skipSlideStep ) { synchronized ( this ) { if ( skipSlideStep || this . selectedSlideModel . previousStep ( ) && this . slidePosition > 0 ) { this . slidePosition = Math . max ( this . slidePosition - 1 , 0 ) ; displaySlide ( getPresentationService ( ) . getPresentation ( ) . getSlid...
Go to previous slide .
3,691
public void showSlideMenu ( ) { synchronized ( this ) { if ( ! this . menuShown . getAndSet ( true ) ) { final SlideMenuModel smm = getModel ( Key . create ( SlideMenuModel . class , this . selectedSlide ) ) ; StackPane . setAlignment ( smm . node ( ) , Pos . CENTER ) ; view ( ) . node ( ) . getChildren ( ) . add ( smm...
Display the slide menu to navigate .
3,692
public YokeRequest wrap ( HttpServerRequest request , Context context , Map < String , Engine > engines , SessionStore store ) { return new YokeRequest ( request , new YokeResponse ( request . response ( ) , context , engines ) , context , store ) ; }
Default implementation of the request wrapper
3,693
private void addEvent ( final List < JRebirthEvent > eventList , final String strLine ) { eventList . add ( new JRebirthEventBase ( strLine ) ) ; }
Add an event to the event list .
3,694
private void initSequential ( final Boolean sequential ) { final Sequential seq = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , Sequential . class ) ; setSequential ( seq == null ? sequential == null ? DEFAULT_SEQUENTIAL_VALUE : sequential : seq . value ( ) ) ; }
Define the sequential value .
3,695
protected UniqueKey < ? extends Command > getCommandKey ( final Class < ? extends Command > commandClass , final Object ... keyPart ) { return Key . create ( commandClass , keyPart ) ; }
Return the command key .
3,696
@ SuppressWarnings ( "unchecked" ) protected void buildObject ( ) { final Class < ? > objectType = ClassUtility . findGenericClass ( this . getClass ( ) , OBJECT_EXCLUDED_CLASSES ) ; if ( objectType != null ) { Object keyPart = null ; boolean found = false ; for ( int i = 0 ; ! found && i < getListKeyPart ( ) . size ( ...
Create the default bindable object .
3,697
public void doUnload ( final Wave wave ) { this . eventList = new ArrayList < > ( ) ; final Collection < BallModel > list = new ArrayList < > ( this . ballMap . values ( ) ) ; for ( final BallModel ballModel : list ) { unregisterBall ( ballModel ) ; } }
Unload the event list .
3,698
public void doPlay ( final Wave wave ) { if ( ! this . playing ) { this . playing = true ; this . timeFrame = 0 ; } if ( this . timeFrame < this . eventList . size ( ) - 1 ) { showNext ( this . eventList . get ( this . timeFrame ) ) ; } else { this . playing = false ; } }
Call when event play button is pressed .
3,699
public void doNext ( final Wave wave ) { if ( this . eventList != null && this . timeFrame + 1 < this . eventList . size ( ) ) { showNext ( this . eventList . get ( this . timeFrame + 1 ) ) ; } }
Call when event next button is pressed .