@ -519,7 +519,10 @@ public class EditToolBar extends BasicPane {
if ( javaScriptPane = = null | | ( ( CustomToolBarButton ) widget ) . getJSImpl ( ) = = null ) {
javaScriptPane = JavaScriptActionPane . createDefault ( ) ;
}
javaScriptPane . setResourceInfo ( new JavaScriptResourceInfo ( JavaScriptResourceInfo . Type . WIDGET , ( ( Button ) widget ) . getText ( ) ) ) ;
JavaScriptResourceInfo . PathNode pathNode = JavaScriptResourceInfo . PathNode . create ( JavaScriptResourceInfo . Type . WIDGET , ( ( Button ) widget ) . getText ( ) ) ;
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo ( ) . addFirstPathNode ( pathNode ) ;
javaScriptPane . setResourceInfo ( javaScriptResourceInfo ) ;
javaScriptPane . setPreferredSize ( new Dimension ( 750 , 500 ) ) ;
BasicDialog dialog = javaScriptPane . showWindow ( SwingUtilities . getWindowAncestor ( ButtonPane . this ) ) ;
@ -539,27 +542,28 @@ public class EditToolBar extends BasicPane {
}
} ;
/ * *
* 更新
* @param widget 对应组件
* /
public void populate ( Widget widget ) {
this . widget = widget ;
card . show ( centerPane , "none" ) ;
if ( widget instanceof Button ) {
populateDefault ( ) ;
}
if ( widget instanceof Export ) {
populateExport ( ) ;
} else if ( widget instanceof AppendColumnRow ) {
populateAppendColumnRow ( ) ;
} else if ( widget instanceof Submit ) {
populateSubmit ( ) ;
} else if ( widget instanceof CustomToolBarButton ) {
populateCustomToolBarButton ( ) ;
} else if ( widget instanceof Email ) {
populateEmail ( ) ;
}
/ * *
* 更新
*
* @param widget 对应组件
* /
public void populate ( Widget widget ) {
this . widget = widget ;
card . show ( centerPane , "none" ) ;
if ( widget instanceof Button ) {
populateDefault ( ) ;
}
if ( widget instanceof Export ) {
populateExport ( ) ;
} else if ( widget instanceof AppendColumnRow ) {
populateAppendColumnRow ( ) ;
} else if ( widget instanceof Submit ) {
populateSubmit ( ) ;
} else if ( widget instanceof CustomToolBarButton ) {
populateCustomToolBarButton ( ) ;
} else if ( widget instanceof Email ) {
populateEmail ( ) ;
}
Set < ExtraButtonToolBarProvider > extraButtonSet = ExtraDesignClassManager . getInstance ( ) . getArray ( ExtraButtonToolBarProvider . XML_TAG ) ;
for ( ExtraButtonToolBarProvider provider : extraButtonSet ) {
@ -572,21 +576,22 @@ public class EditToolBar extends BasicPane {
count . setValue ( ( ( AppendColumnRow ) widget ) . getCount ( ) ) ;
}
private void populateExport ( ) {
card . show ( centerPane , "export" ) ;
Export export = ( Export ) widget ;
this . pdf . setSelected ( export . isPdfAvailable ( ) ) ;
this . excelP . setSelected ( export . isExcelPAvailable ( ) ) ;
this . excelO . setSelected ( export . isExcelOAvailable ( ) ) ;
this . excelS . setSelected ( export . isExcelSAvailable ( ) ) ;
this . word . setSelected ( export . isWordAvailable ( ) ) ;
this . image . setSelected ( export . isImageAvailable ( ) ) ;
if ( exportToolBarProviders ! = null ) {
for ( int i = 0 ; i < exportToolBarProviders . length ; i + + ) {
exportToolBarProviders [ i ] . populate ( ) ; ;
}
}
}
private void populateExport ( ) {
card . show ( centerPane , "export" ) ;
Export export = ( Export ) widget ;
this . pdf . setSelected ( export . isPdfAvailable ( ) ) ;
this . excelP . setSelected ( export . isExcelPAvailable ( ) ) ;
this . excelO . setSelected ( export . isExcelOAvailable ( ) ) ;
this . excelS . setSelected ( export . isExcelSAvailable ( ) ) ;
this . word . setSelected ( export . isWordAvailable ( ) ) ;
this . image . setSelected ( export . isImageAvailable ( ) ) ;
if ( exportToolBarProviders ! = null ) {
for ( int i = 0 ; i < exportToolBarProviders . length ; i + + ) {
exportToolBarProviders [ i ] . populate ( ) ;
;
}
}
}
private void populateEmail ( ) {
card . show ( centerPane , EMAIL ) ;
@ -694,7 +699,10 @@ public class EditToolBar extends BasicPane {
if ( customToolBarButton . getJSImpl ( ) = = null ) {
this . javaScriptPane = JavaScriptActionPane . createDefault ( ) ;
}
javaScriptPane . setResourceInfo ( new JavaScriptResourceInfo ( JavaScriptResourceInfo . Type . CUSTOM_BUTTON , ( ( Button ) widget ) . getText ( ) ) ) ;
JavaScriptResourceInfo . PathNode pathNode = JavaScriptResourceInfo . PathNode . create ( JavaScriptResourceInfo . Type . CUSTOM_BUTTON , ( ( Button ) widget ) . getText ( ) ) ;
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo ( ) . addFirstPathNode ( pathNode ) ;
javaScriptPane . setResourceInfo ( javaScriptResourceInfo ) ;
customToolBarButton . setJSImpl ( this . javaScriptPane . updateBean ( ) ) ;
}