@ -69,12 +69,12 @@ public enum JFormType {
} ;
} ;
private int type ;
private int type ;
private boolean newType ;
private boolean newType ;
private PreviewProvider p reviewType;
private PreviewProvider defaultP reviewType;
JFormType ( int type , PreviewProvider p reviewType) {
JFormType ( int type , PreviewProvider defaultP reviewType) {
this . type = type ;
this . type = type ;
this . newType = ( type = = 1 ) ;
this . newType = ( type = = 1 ) ;
this . previewType = p reviewType;
this . defaultPreviewType = defaultP reviewType;
}
}
public int getType ( ) {
public int getType ( ) {
@ -85,8 +85,8 @@ public enum JFormType {
return newType ;
return newType ;
}
}
public PreviewProvider getPreviewType ( ) {
public PreviewProvider getDefault PreviewType ( ) {
return p reviewType;
return defaultP reviewType;
}
}
public abstract void switchUI ( ) ;
public abstract void switchUI ( ) ;
@ -128,6 +128,14 @@ public enum JFormType {
* @date : 2020 / 12 / 17 16 : 17
* @date : 2020 / 12 / 17 16 : 17
* /
* /
public void updatePreviewType ( JTemplate jTemplate ) {
public void updatePreviewType ( JTemplate jTemplate ) {
jTemplate . setPreviewType ( this . getPreviewType ( ) ) ;
if ( jTemplate . getPreviewType ( ) ! = null ) {
PreviewProvider [ ] previewProviders = jTemplate . supportPreview ( ) ;
for ( PreviewProvider previewProvider : previewProviders ) {
if ( previewProvider . getClass ( ) = = jTemplate . getPreviewType ( ) . getClass ( ) ) {
return ;
}
}
}
jTemplate . setPreviewType ( this . getDefaultPreviewType ( ) ) ;
}
}
}
}