Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » [neon] Replacement for AbstractTableField.execUpdateTableStatus()
[neon] Replacement for AbstractTableField.execUpdateTableStatus() [message #1752726] Thu, 26 January 2017 14:50 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 566
Registered: October 2012
Location: Bern, Switzerland
Senior Member
One of the projects I am migrating used AbstractTableField.execUpdateTableStatus() to hook into table updates to run some global validations.

This method no longer exists. The Migration Guide has this to say:
Quote:
ITableField.updateTableStatus() was dropped without replacement. Simply set the table status with ITableField.setTableStatus().


However, this does not help me, I am looking for some way to hook into setTableStatus() calls, I cannot find a execSetTableStatus() callback.
Re: [neon] Replacement for AbstractTableField.execUpdateTableStatus() [message #1752773 is a reply to message #1752726] Fri, 27 January 2017 07:46 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 90
Registered: November 2010
Member
Urs,

I'm not quite sure what you are trying to achieve, but maybe one of the following possibilities suit your purpose:
1. Add a property change listener to the "tableStatus" property:
    table.addPropertyChangeListener(ITable.PROP_TABLE_STATUS, new PropertyChangeListener() {
      @Override
      public void propertyChange(PropertyChangeEvent evt) {
        IStatus status = (IStatus) evt.getNewValue();
        System.out.println("New status is: " + status);
      }
    });

2. Overwrite setTableStatus() in your table:
public class MyTable extends AbstractTable {

  @Override
  public void setTableStatus(IStatus status) {
    System.out.println("New status is: " + status);
    super.setTableStatus(status);
  }
}


Regards,
Beat
Re: [neon] Replacement for AbstractTableField.execUpdateTableStatus() [message #1752872 is a reply to message #1752773] Mon, 30 January 2017 08:04 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 566
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Beat

Thanks for your reply.
Quote:
I'm not quite sure what you are trying to achieve

Honestly, neihter am I Wink It is code written in one of our projects that I am stuck with to migrate it from Mars to Neon and I do unfortuntely not have access to the author of that part of the code and it is not self explanatory.

I think I'll use the change listener approach to solve this issue.

Thanks.
Urs

[Updated on: Mon, 30 January 2017 08:06]

Report message to a moderator

Previous Topic:[neon] AbstractPageWithTable and Custom TableControls
Next Topic:[neon] IExceptionHandlerService.handleException() and ProcessingException.addContextMessage()
Goto Forum:
  


Current Time: Fri Oct 20 01:45:53 GMT 2017

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

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