Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Table using ColumnWeightData not resizing correctely
Table using ColumnWeightData not resizing correctely [message #1716091] Tue, 01 December 2015 09:23
Xavipen Mising name is currently offline Xavipen Mising nameFriend
Messages: 59
Registered: March 2011
I have a Group with GridLayout that contains a Composite with a TableColumnLayout and two buttons.

The composite is set to FILL both vertical and horizontal. Additionally the Composite is set to grabExcessHorizontalSpace so it can adjust to different screen sizes.

If for the TableColumns, I only use ColumnPixelData, everything works fine. However, if i set one of the TableColumns to ColumnWeightData then the group is allways slightly bigger than the Parent Composite where i place it.

Moreover, I have used it in a Section within a form, the parent Composite has a Scrollbar panel. Every time the section is close an open the horizontal size of the parent composite grows bigger.

Could somebody tell me if i am missing something?

Here is the code

Group grpPermittedGlobalVcids = new Group(compositeMain, SWT.NONE);
    grpPermittedGlobalVcids.setLayout(new GridLayout(2, false));
    GridData gd_grpPermittedGlobalVcids = new GridData(SWT.FILL, SWT.TOP, false, false, 7, 1);
    gd_grpPermittedGlobalVcids.minimumHeight = 145;
    gd_grpPermittedGlobalVcids.heightHint = 155;
    grpPermittedGlobalVcids.setText("Permitted Global VCIDs");

    Composite composite_1 = new Composite(grpPermittedGlobalVcids, SWT.NONE);
    GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 3);
    gd_composite_1.heightHint = 138;
    TableColumnLayout tcl_composite_1 = new TableColumnLayout();

    tableViewer = new TableViewer(composite_1, SWT.BORDER | SWT.FULL_SELECTION);
    table_1 = tableViewer.getTable();

    tableViewerColumnSpacecraftId = new TableViewerColumn(tableViewer, SWT.NONE);
    TableColumn tblclmnSpacecraftId = tableViewerColumnSpacecraftId.getColumn();
    tcl_composite_1.setColumnData(tblclmnSpacecraftId, new ColumnPixelData(150, true, true));
    tblclmnSpacecraftId.setText("Spacecraft ID");

    tableViewerColumnFrameVersion = new TableViewerColumn(tableViewer, SWT.NONE);
    TableColumn tblclmnFrameVersion = tableViewerColumnFrameVersion.getColumn();
    tcl_composite_1.setColumnData(tblclmnFrameVersion, new ColumnPixelData(150, true, true));
    tblclmnFrameVersion.setText("Frame Version");

    tableViewerColumnVcId = new TableViewerColumn(tableViewer, SWT.NONE);
    TableColumn tblclmnVirtualChannel = tableViewerColumnVcId.getColumn();
    tcl_composite_1.setColumnData(tblclmnVirtualChannel, new ColumnPixelData(150, true, true));
    tblclmnVirtualChannel.setText("Virtual Channel");

    btnAddGVCID = new Button(grpPermittedGlobalVcids, SWT.NONE);
    btnAddGVCID.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

    btnRemoveGVCID = new Button(grpPermittedGlobalVcids, SWT.NONE);
    new Label(grpPermittedGlobalVcids, SWT.NONE);
Previous Topic:ContentProposalAdapter popup to show on top of textbox
Next Topic:How to draw Annotation in SourceViewer
Goto Forum:

Current Time: Mon Apr 19 00:54:56 GMT 2021

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

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

Back to the top