Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Rap Table field default menu visibility problem(How to suppress default menu for Table field?)
Rap Table field default menu visibility problem [message #1266529] Fri, 07 March 2014 10:26 Go to next message
Eclipse UserFriend
In scout AbstractExtensibleTable (Table field) comes with default menus, is there a way to make them not visible?
I only see Sort Enabled property to set visibility of Sorting Menu.
Is there a way to set Visibility of other Menus like Reset Columns, Organize columns, and Column filters.....?
Re: Rap Table field default menu visibility problem [message #1268183 is a reply to message #1266529] Mon, 10 March 2014 02:49 Go to previous messageGo to next message
Eclipse UserFriend
Have a look at the following code, where which I've used to totally change the way the table header menu behaves. If you just want to get rid of it, the easiest way is probably to just override execAddHeaderMenus() and to nothing in it.

public class ReducedMenuTable extends AbstractTable {

  @Override
  protected void execAddHeaderMenus(TableEvent e) throws ProcessingException {
    if (getTableCustomizer() != null) {
      if (e.getPopupMenuCount() > 0) {
        e.addPopupMenu(new MenuSeparator());
      }
      for (IMenu m : new IMenu[]{new AddCustomColumnMenu(this), new ModifyCustomColumnMenu(this), new RemoveCustomColumnMenu(this)}) {
        m.prepareAction();
        if (m.isVisible()) {
          e.addPopupMenu(m);
        }
      }
    }
    if (e.getPopupMenuCount() > 0) {
      e.addPopupMenu(new MenuSeparator());
    }
    //for (IMenu m : new IMenu[]{new ReducedResetColumnsMenu(this), new OrganizeColumnsMenu(this)}) {
    for (IMenu m : new IMenu[]{new ReducedResetColumnsMenu(this)}) {
      m.prepareAction();
      if (m.isVisible()) {
        e.addPopupMenu(m);
      }
    }

    boolean separatorNeeded = false;
    if (e.getPopupMenuCount() > 0) {
      separatorNeeded = true;
    }
    for (IColumn c : getColumnSet().getAllColumnsInUserOrder()) {
      if (c.isDisplayable()) {
        if (separatorNeeded) {
          e.addPopupMenu(new MenuSeparator());
          separatorNeeded = false;
        }
        IMenu m = new CheckColumnMenu(this, c);
        m.prepareAction();
        m.setEnabled(c.isDisplayable());
        e.addPopupMenu(m);
      }
    }
  }

}
Re: Rap Table field default menu visibility problem [message #1268343 is a reply to message #1268183] Mon, 10 March 2014 07:34 Go to previous message
Eclipse UserFriend
Thank you for the response, it worked.
Previous Topic:org.eclipse.scout.mockito-all ???
Next Topic:Unique field Id (Class Id) with aditional attributes for RCP Jubula Tests
Goto Forum:
  


Current Time: Sat Nov 08 01:18:08 EST 2025

Powered by FUDForum. Page generated in 0.04070 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top