egovconcepts / jacp

Automatically exported from code.google.com/p/jacp
0 stars 0 forks source link

Cannot remove button from JACPToolBar #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I add add a button in @OnStart function.
  @OnStart
  public void onStartComponent(final FXComponentLayout layout) {
    JACPToolBar topbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
    topbar.add(cardButton);
  }

then I remove the button in @OnTearDown
  @OnTearDown
  public void onTearDownComponent(final FXComponentLayout layout) {
    JACPToolBar topbar = layout.getRegisteredToolBar(ToolbarPosition.NORTH);
    topbar.getItems().remove(cardButton);
  }

I can't remove the button from JACPToolBar with getItems().remove(), because 
the button in fact is in the HBox or VBox inside ToolBar.

I suggest the JACPToolbar should add the methods remove() and removeOnEnd() 
like add() and addOnEnd()。

Original issue reported on code.google.com by markench...@gmail.com on 8 May 2012 at 3:55