Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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 15:26 Go to next message
Rajitha Kantamneni is currently offline Rajitha KantamneniFriend
Messages: 7
Registered: January 2014
Junior Member
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 06:49 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 572
Registered: October 2012
Location: Bern, Switzerland
Senior Member
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 11:34 Go to previous message
Rajitha Kantamneni is currently offline Rajitha KantamneniFriend
Messages: 7
Registered: January 2014
Junior Member
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: Tue Nov 12 22:13:07 GMT 2019

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

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

Back to the top