Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » CTabFolder Issue seen with E4?
CTabFolder Issue seen with E4? [message #1104939] Mon, 09 September 2013 02:05 Go to next message
e4 user is currently offline e4 user
Messages: 2
Registered: September 2013
Junior Member
I recently migrated my application to e4. I am observing a weird behavior with CTabFolder.

Basically I use CTabFolder with XViewer (based on swt tree). Even though CTabFolder has buttons added to it, they do not get displayed as the application starts up. Only after I click somewhere - either to select a tree item or to sort a column, the buttons in the CTabFolder show up.

I am by no means an expert on either CTabFolder or e4 and use this forum extensively to navigate through the issues I faced in migrating my application to e4. I must say Kepler made my life very easy from stability point of view and I am very happy with the migration so far. If you could shed some light on what the underlying issue might be, I can get this last bit out of my way.

Here is the code where I populate the CTabFolder - just in case:

tabFolder = new CTabFolder(parent, SWT.BORDER);
GridData gd_tabFolder = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
tabFolder.setLayoutData(gd_tabFolder);
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));

tbtmParameterOptions = new CTabItem(tabFolder, SWT.NONE);
tbtmParameterOptions.setText("Manage Parameters");

parameterToolbar = new ToolBar(tabFolder, SWT.FLAT | SWT.RIGHT);
tbtmParameterOptions.setControl(parameterToolbar);

refreshItem = new ToolItem(parameterToolbar, SWT.PUSH);
refreshItem.setImage(NTImageCache.getImage("refresh.png"));
refreshItem.setText("Refresh");
refreshItem.setToolTipText("Refresh");

editParameterItem = new ToolItem(parameterToolbar, SWT.PUSH);
editParameterItem.setImage(NTImageCache.getImage("edit_item.png"));
editParameterItem.setText("Edit Parameter");
editParameterItem.setToolTipText("Edit Parameter");

deleteParameterItem = new ToolItem(parameterToolbar, SWT.PUSH);
deleteParameterItem.setImage(NTImageCache.getImage("delete_item.png"));
deleteParameterItem.setText("Delete Parameter");
deleteParameterItem.setToolTipText("Delete Parameter");

tabFolder.setSelection(tbtmParameterOptions);
tabFolder.setSimple(false);

[Updated on: Mon, 09 September 2013 10:19]

Report message to a moderator

Re: CTabFolder Issue seen with E4? [message #1105213 is a reply to message #1104939] Mon, 09 September 2013 10:18 Go to previous message
e4 user is currently offline e4 user
Messages: 2
Registered: September 2013
Junior Member
Never mind. It was an issue with the layout height. I added the following statement and resolved the problem.

gd_tabFolder.heightHint = 32;


e4 user wrote on Mon, 09 September 2013 02:05
I recently migrated my application to e4. I am observing a weird behavior with CTabFolder.


Basically I use CTabFolder with XViewer (based on swt tree). Even though CTabFolder has buttons added to it, they do not get displayed as the application starts up. Only after I click somewhere - either to select a tree item or to sort a column, the buttons in the CTabFolder show up.

I am by no means an expert on either CTabFolder or e4 and use this forum extensively to navigate through the issues I faced in migrating my application to e4. I must say Kepler made my life very easy from stability point of view and I am very happy with the migration so far. If you could shed some light on what the underlying issue might be, I can get this last bit out of my way.

Here is the code where I populate the CTabFolder - just in case:

tabFolder = new CTabFolder(parent, SWT.BORDER);
GridData gd_tabFolder = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
tabFolder.setLayoutData(gd_tabFolder);
tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));

tbtmParameterOptions = new CTabItem(tabFolder, SWT.NONE);
tbtmParameterOptions.setText("Manage Parameters");

parameterToolbar = new ToolBar(tabFolder, SWT.FLAT | SWT.RIGHT);
tbtmParameterOptions.setControl(parameterToolbar);

refreshItem = new ToolItem(parameterToolbar, SWT.PUSH);
refreshItem.setImage(NTImageCache.getImage("refresh.png"));
refreshItem.setText("Refresh");
refreshItem.setToolTipText("Refresh");

editParameterItem = new ToolItem(parameterToolbar, SWT.PUSH);
editParameterItem.setImage(NTImageCache.getImage("edit_item.png"));
editParameterItem.setText("Edit Parameter");
editParameterItem.setToolTipText("Edit Parameter");

deleteParameterItem = new ToolItem(parameterToolbar, SWT.PUSH);
deleteParameterItem.setImage(NTImageCache.getImage("delete_item.png"));
deleteParameterItem.setText("Delete Parameter");
deleteParameterItem.setToolTipText("Delete Parameter");

tabFolder.setSelection(tbtmParameterOptions);
tabFolder.setSimple(false);

[Updated on: Mon, 09 September 2013 10:19]

Report message to a moderator

Previous Topic:Take screenshot of Windows E4 rcp application window
Next Topic:Is Toolbar Contribution provisional?
Goto Forum:
  


Current Time: Wed Jul 30 15:31:57 EDT 2014

Powered by FUDForum. Page generated in 0.01721 seconds