@ -9,10 +9,16 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ToolBarDef ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.stable.ArrayUtils ;
import com.fr.stable.Filter ;
import com.fr.stable.Nameable ;
import javax.swing.* ;
import java.awt.* ;
import javax.swing.BorderFactory ;
import javax.swing.JPanel ;
import javax.swing.JSplitPane ;
import java.awt.BorderLayout ;
import java.awt.CardLayout ;
import java.util.Arrays ;
import java.util.stream.Stream ;
/ * *
* Coder : zack
@ -27,6 +33,8 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
ShortCut4JControlPane [ ] shorts ;
NameableCreator [ ] creators ;
protected Filter < NameableCreator > creatorsFilter ;
private ToolBarDef toolbarDef ;
UIToolbar toolBar ;
@ -38,6 +46,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
JControlPane ( ) {
this . initShortCutFactory ( ) ;
this . initCreatorsFilter ( ) ;
this . initComponentPane ( ) ;
}
@ -106,6 +115,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
this . checkButtonEnabled ( ) ;
}
protected void initCreatorsFilter ( ) {
this . creatorsFilter = nameableCreator - > true ;
}
protected void initCardPane ( ) {
this . controlUpdatePane = createControlUpdatePane ( ) ;
@ -183,7 +196,12 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
}
public NameableCreator [ ] creators ( ) {
return creators = = null ? new NameableCreator [ 0 ] : creators ;
if ( creators = = null ) {
return new NameableCreator [ 0 ] ;
} else {
Stream < NameableCreator > nameableCreatorStream = Arrays . stream ( creators ) . filter ( creator - > creatorsFilter . accept ( creator ) ) ;
return nameableCreatorStream . toArray ( NameableCreator [ ] : : new ) ;
}
}
/ * *