Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » column visibility
column visibility [message #563910] Mon, 14 August 2006 15:36
remi is currently offline remiFriend
Messages: 9
Registered: July 2009
Junior Member
Hello, I'am trying to hide/show a defined column of the Nebula Grid (12*3)
bellow that contains various GridEditor.
The problem is that even if the column visibility is set to false, the
column is still displayed on the screen.

May I miss something or is it a bug?
Thanks in advance

Rémi

************************************************************ ***********
Grid table = new Grid (top, SWT.BORDER | SWT.MULTI);
table.setLinesVisible (true);
table.setHeaderVisible(true);

final GridColumn myColumn1 = new GridColumn(table, SWT.NONE);
myColumn1.setWidth (100);
final GridColumn myColumn2 = new GridColumn(table, SWT.NONE);
myColumn2.setWidth (100);
final GridColumn myColumn3 = new GridColumn(table, SWT.NONE);
myColumn3.setWidth (100);

for (int i=0; i<12; i++) {
new GridItem (table, SWT.NONE);
}
GridItem [] items = table.getItems ();
for (int i=0; i<items.length; i++) {
GridEditor editor = new GridEditor (table);
CCombo combo = new CCombo (table, SWT.NONE);
combo.setText("CCombo");
combo.add("item 1");
combo.add("item 2");
editor.grabHorizontal = true;
editor.setEditor(combo, items[i], 0);
editor = new GridEditor (table);
Text text = new Text (table, SWT.NONE);
text.setText("Text");
editor.grabHorizontal = true;
editor.setEditor(text, items[i], 1);
editor = new GridEditor (table);
Button button = new Button (table, SWT.CHECK);
button.pack ();
editor.minimumWidth = button.getSize ().x;
editor.horizontalAlignment = SWT.LEFT;
editor.setEditor (button, items[i], 2);
}

final Button button = new Button(top, SWT.CHECK);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent e) {
System.out.println("we hide one column of the Nebula Grid");
System.out.println(button.getSelection());
myColumn1.setVisible(button.getSelection());
System.out.println(myColumn1.getVisible());
}
});
button.setText("Check Button");
************************************************************ ***********
Previous Topic:GridEditor issue
Next Topic:GridEditor issue
Goto Forum:
  


Current Time: Fri Apr 26 03:46:49 GMT 2024

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

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

Back to the top