Customizing toolbars in the Enterprise console

You can customize the toolbars in the Explore and Query tabs, as well as the toolbar for viewing project element details.

To customize a toolbar, add a teamserver:button tag to the corresponding toolbar. For example, /custom/tableToolbar.jsp, which contains by default:

<teamserver:toolbar styleClass="items" separatorStyleClass="itemseparator">
<teamserver:button model="#{TableToolbarBean.create}"/>
<teamserver:button model="#{TableToolbarBean.details}"/>
<teamserver:button model="#{TableToolbarBean.edit}"/>
<teamserver:button model="#{TableToolbarBean.delete}"/>
<teamserver:button model="#{TableToolbarBean.copy}"/>
<teamserver:button model="#{TableToolbarBean.lock}"/>
<teamserver:button model="#{TableToolbarBean.unlock}"/>
<teamserver:button model="#{TableToolbarBean.releaseLock}"/>
<teamserver:button model="#{TableToolbarBean.history}"/>
<teamserver:button model="#{TableToolbarBean.help}"/>

You can add or remove existing links, redefine behaviors such as its visibility, hook the existing action, or change it. You can also add HTML or JSP to it.

For example, you can redefine the lock button as follows, to hide it from basic users:

<teamserver:button model="#{TableToolbarBean.lock}" rendered="#{MyBean.basicUser}"/>

Alternatively, you can create your own button:

<teamserver:button action="#{MyBean.dosomething}" icon="mybutton.png" title="Click Me"/>

You can also redefine TableToolbarBean, to hook its action:

public class MyTableToolbarBean extends TableToolbarBean {
  public MyTableToolbarBean() {
    setRefresh(new IlrCommandDelegate(getRefresh()) {
      public String action() {
        // do something before refreshing
        System.err.println("Refresh has been called");
        // Then calls the RTS refresh action.
        return delegate.action();
      }
    }
  }
}

In this case, you redefine TableToolbarBean in extended-faces-config.xml. For example:

<managed-bean>
  <managed-bean-name>TableToolbarBean</managed-bean-name>
  <managed-bean-class>mypackage.MyTableToolbarBean</managed-bean-class>
  <managed-bean-scope>session</managed-bean-scope>
</managed-bean>