Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 374769

Summary: Enhance ISTDataViewersField with a new method, in order to support columns hideen by default
Product: [Tools] Linux Tools Reporter: Xavier Raynaud <xraynaud>
Component: GProfAssignee: Xavier Raynaud <xraynaud>
Status: CLOSED FIXED QA Contact: Xavier Raynaud <xraynaud>
Severity: enhancement    
Priority: P3 CC: akurtakov, jerome.correnoz, lilia.ghachem
Version: unspecified   
Target Milestone: 2.0   
Hardware: All   
OS: All   
Whiteboard:

Description Xavier Raynaud CLA 2012-03-20 10:55:09 EDT
Build Identifier: 

I would like to modify ISTDataViewersField with a new method, in order to support columns hidden by default.

Something like:
  boolean isShowingByDefault();

The default implementation (AbstractSTDataViewersField) will return true.
In other words, the default behaviour will not change.

However, it will now possible to have columns hidden by default. It can be interesting, especially for columns with "data for advanced users". Such columns will be displayed only if user explicitly wants to displays them.

Reproducible: Always
Comment 1 Xavier Raynaud CLA 2012-03-20 10:56:26 EDT
Jerome/Lilia:

I opened this RFE for you.
Are you OK for this enhancement ?

Xavier
Comment 2 Lilia Ghachem CLA 2012-03-22 09:37:27 EDT
(In reply to comment #1)
> Jerome/Lilia:
> 
> I opened this RFE for you.
> Are you OK for this enhancement ?
> 
> Xavier

Absolutely OK for me.
I needed such behavior in a recently implemented Debug view where I had to define for each column a constructor (AbstractSTDataViewersField) with boolean as a parameter for showing/not.

Thanks Xavier!
Comment 3 Xavier Raynaud CLA 2012-03-22 09:52:57 EDT
Hi Lilia,

Ok, many thanks.
I'm not sure to understand your comment.
Do you have already implemented this feature ? Or is it only an identified requirement from your side ?

Xavier
Comment 4 Lilia Ghachem CLA 2012-03-22 11:34:39 EDT
Sorry if I was not clear.
Actually, it is a requirement I identified and which I implemented in my plugin not in dataviewers side. your solution sounds better.

Some code snippets in my current implementation:

public abstract class MyAbstractField extends AbstractSTDataViewersField {

  public myAbstractField (boolean show) {
     super();
    setShowing(show);
  }
  [...]
}

public class myFieldx extends MyAbstractField {
  
  public myFieldx (boolean b){
     super(b);
  }
  [...]
}

public class myViewer extends AbstractSTTableViewer {

  public ISTDataViewersField[] getAllFields() {
     return new ISTDataViewersField[] {
               new myField1(true);
               new myField2(true);
               new myField3(false);
               new myField4(false);
  } 

}

thus, by default, the two last columns hidden.
I hope it is clearer now?

Lilia
Comment 5 Xavier Raynaud CLA 2013-04-05 05:20:36 EDT
a patch has been submitted here:
https://git.eclipse.org/r/#/c/11672/
Comment 6 Xavier Raynaud CLA 2013-04-05 07:47:56 EDT
fixed by rev 444a56364afb015c59f7b73d52707913404f07ca