Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » [neon] AbstractOutlineViewButton behaving differently from Mars
[neon] AbstractOutlineViewButton behaving differently from Mars [message #1751350] Mon, 09 January 2017 10:09 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 565
Registered: October 2012
Location: Bern, Switzerland
Senior Member
In our application we have several outlines in various DesktopExtensions. Their accesibility to users depends on the users' permissions.

In Mars we solved this by overriding the initConfig() method of the corresponding AbstractOutlineViewButton. If the user didn't have the required permissions, we called setVisible(false) and setVisibleGranted(false) which caused the button to not be shown on the GUI.

However, in Neon, these OutlineViewButtons are always shown, even though their visibility has been set to false.

Is this a bug? Or do we need to change our setup to make this work?
Re: [neon] AbstractOutlineViewButton behaving differently from Mars [message #1751526 is a reply to message #1751350] Wed, 11 January 2017 07:40 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 88
Registered: November 2010
Member
I think you should override execInitAction() instead of initConfig(). In AbstractOutlineViewButton.execInitAction(), setVisible[Granted]() is called with the corresponding outline's values, so this method overrides your previously set values.

public abstract class AbstractOutlineViewButton extends AbstractViewButton implements IOutlineViewButton {
   ...
  @Override
  protected void execInitAction() {
    setVisibleGranted(m_outline.isVisibleGranted());
    setVisible(m_outline.isVisible());
    setEnabled(m_outline.isEnabled());
    ...


It should be sufficient for your case to set the "visible granted" property. The "visible" property is intended for business logic, while the "visible granted" is intended for permissions. An object is only available if all flags are true. (But be aware, that an object with "visible granted = false" can never be visible again, as the object is not sent to the UI at all.)

Regards,
Beat
Re: [neon] AbstractOutlineViewButton behaving differently from Mars [message #1751565 is a reply to message #1751526] Wed, 11 January 2017 14:29 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 565
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Perfect, that works now!
Previous Topic:AbstractBeanColumn<VALUE>
Next Topic:[Scout 6.1] BrowserField
Goto Forum:
  


Current Time: Wed Jul 26 07:00:27 GMT 2017

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

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